NReco.CF.Taste.Impl.Similarity AbstractItemSimilarity
NReco.CF.Taste.Impl.Similarity AbstractSimilarity
NReco.CF.Taste.Impl.Similarity PearsonCorrelationSimilarity
Namespace: NReco.CF.Taste.Impl.Similarity
Assembly: NReco.Recommender (in NReco.Recommender.dll) Version: 1.0.0.0 (1.0.0.0)
The PearsonCorrelationSimilarity type exposes the following members.
Name | Description | |
---|---|---|
PearsonCorrelationSimilarity(IDataModel) | Initializes a new instance of the PearsonCorrelationSimilarity class | |
PearsonCorrelationSimilarity(IDataModel, Weighting) | Initializes a new instance of the PearsonCorrelationSimilarity class |
Name | Description | |
---|---|---|
AllSimilarItemIDs | (Inherited from AbstractItemSimilarity.) | |
Equals | (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ItemSimilarities | (Inherited from AbstractSimilarity.) | |
ItemSimilarity | (Inherited from AbstractSimilarity.) | |
Refresh | (Inherited from AbstractSimilarity.) | |
SetPreferenceInferrer | (Inherited from AbstractSimilarity.) | |
ToString | (Inherited from AbstractSimilarity.) | |
UserSimilarity | (Inherited from AbstractSimilarity.) |
- sumX2: sum of the square of all X's preference values
- sumY2: sum of the square of all Y's preference values
- sumXY: sum of the product of X and Y's preference value for all items for which both X and Y express a preference
sumXY / sqrt(sumX2 * sumY2)
Note that this correlation "centers" its data, shifts the user's preference values so that each of their means is 0. This is necessary to achieve expected behavior on all data sets.
This correlation implementation is equivalent to the cosine similarity since the data it receives is assumed to be centered -- mean is 0. The correlation may be interpreted as the cosine of the angle between the two vectors defined by the users' preference values.
For cosine similarity on uncentered data, see UncenteredCosineSimilarity.