cosine_similarity: Vector cosine similarity

Description Usage Arguments Value

Description

Returns the cosine similarity between 2 vectors

Usage

1
cosine_similarity(query_vector, tfidf_matrix, tfidf_crossprod_mat)

Arguments

query_vector

A vector to compare to the tf-idf matrix. Length of vector is equal to number of columns of tf-idf matrix

tfidf_matrix

Sparse tf-idf matrix (computed from tfidf)

tfidf_crossprod_mat

The cross-product matrix for the tf-idf matrix (computed with crossprod_matrix)

Value

Cosine similarity between query vector and each *row* in tf-idf matrix


diogocamacho/rpegeos documentation built on June 4, 2019, 6:37 p.m.