mlpy.knowledgerep.cbr.similarity.CosineSimilarity.compute_similarity

CosineSimilarity.compute_similarity(data_point)[source]

Computes the similarity.

Computes the similarity between the data point and the data in the indexing structure using the function cosine_similarity from sklearn.metrics.pairwise.

The resulting similarity ranges from -1 meaning exactly opposite, to 1 meaning exactly the same, with 0 indicating orthogonality (decorrelation), and in-between values indicating intermediate similarity or dissimilarity. The results are returned in a collection of similarity statistics (Stat).

Parameters:

data_point : list[float]

The raw data point to compare against the data points stored in the indexing structure.

Returns:

list[Stat] :

A collection of similarity statistics.