Calculate the Cosine Similarity Between Vectors
calculate_similarity.Rd
This function uses the `lsa` package to calculate the `cos` between vectors. For this function, you should have a matrix of tokens by dimensions, and you can specify which direction you want to calculate the cosine (by rows or columns).
Arguments
- words
If you want to filter the matrix to only a set of tokens, include a vector of tokens. The `by` argument will be used to filter the data to only these values. Note that if you want to filter by rows, the row names should represent your tokens, not the first column.
- dimensions
Your matrix of numerical dimension values.
- by
use `1` to calculate by row and `2` to calculate by column.