> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exploratory.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Cosine Similarity

## Introduction

Calculate cosine similarity of each of the pairs of categories. This is often used as similarity of documents.

## How to Access?

You can access from 'Add' (Plus) button.

![](https://mintcdn.com/exploratory-inc/VL_CUSf6Xsk2Ztlz/en/stats/images/sim_add.png?fit=max\&auto=format\&n=VL_CUSf6Xsk2Ztlz\&q=85\&s=07a9ab2e241fdb54a7cc8dca52ad84b8)

## How to Use?

### Calculate Distances Among Categories

![](https://mintcdn.com/exploratory-inc/VL_CUSf6Xsk2Ztlz/en/stats/images/sim_dialog.png?fit=max\&auto=format\&n=VL_CUSf6Xsk2Ztlz\&q=85\&s=d28746b0c7b3ab3645506c27c40eaaf7)

#### Column Selection

Category, dimension and measure are like this.

![](https://mintcdn.com/exploratory-inc/zHnBjfk3GbQveXFA/en/ml/images/skv_origin.png?fit=max\&auto=format\&n=zHnBjfk3GbQveXFA\&q=85\&s=40b0935d4337fd53b67a569697500fe9)

Category column is a column that has categories. They are parameterized by measures with the dimensions.

![](https://mintcdn.com/exploratory-inc/zHnBjfk3GbQveXFA/en/ml/images/skv_expand.png?fit=max\&auto=format\&n=zHnBjfk3GbQveXFA\&q=85\&s=9f6cd43b2710e4a0dc2db37fca082f6a)

In this case, similarities of airline carriers are calculated based on count of flight. Think that each carrier is represented as a vector of flight count in each week day and cosine similarities of them are calculated.

If there are duplicated values, they will be aggregated by "Aggregate with".

### Parameters

* Keep Only Unique Pairs (Optional) - The default is FALSE. Whether the pair of output should be unique. If this is TRUE, a pair appears only once but if it's FALSE, a pair appears twice in swapped order. If you want to filter the pairs by names, it's better to be FALSE.
* Keep Diagonal Pairs (Optional) - The default is FALSE. Whether the output should contain the similarity of documents with itself.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.