cosineSimilarity
Document similarities with cosine similarity
Syntax
Description
returns the pairwise cosine similarities for the specified documents using the tf-idf
matrix derived from their word counts. The score in similarities = cosineSimilarity(documents)similarities(i,j)
represents the similarity between documents(i) and
documents(j).
returns similarities between similarities = cosineSimilarity(documents,queries)documents and
queries using tf-idf matrices derived from the word counts in
documents. The score in similarities(i,j)
represents the similarity between documents(i) and
queries(j).
returns pairwise similarities for the documents encoded by the specified bag-of-words or
bag-of-n-grams model using the tf-idf matrix derived from the word counts in
similarities = cosineSimilarity(bag)bag. The score in similarities(i,j) represents
the similarity between the ith and jth documents
encoded by bag.
returns similarities between the documents encoded by the bag-of-words or bag-of-n-grams
model similarities = cosineSimilarity(bag,queries)bag and queries using tf-idf matrices
derived from the word counts in bag. The score in
similarities(i,j) represents the similarity between the
ith document encoded by bag and
queries(j).
returns similarities for the data encoded in the row vectors of the matrix
similarities = cosineSimilarity(M)M. The score in similarities(i,j) represents the
similarity between M(i,:) and M(j,:).
returns similarities between the documents encoded in the matrices similarities = cosineSimilarity(M1,M2)M1
and M2. The score in similarities(i,j) corresponds
to the similarity between M1(i,:) and
M2(j,:).



