C# Класс MyMediaLite.Correlation.Pearson

Shrunk Pearson correlation for rating data

The correlation values are shrunk towards zero, depending on the number of ratings the estimate is based on. Otherwise, we would give too much weight to similarities estimated from just a few examples.

http://en.wikipedia.org/wiki/Pearson_correlation

We apply shrinkage as in formula (5.16) of chapter 5 of the Recommender Systems Handbook. Note that the shrinkage formula has changed betweem the two publications. It is now based on the assumption that the true correlations are normally distributed; the shrunk estimate is the posterior mean of the empirical estimate.

Literature: Yehuda Koren: Factor in the Neighbors: Scalable and Accurate Collaborative Filtering, Transactions on Knowledge Discovery from Data (TKDD), 2009. http://public.research.att.com/~volinsky/netflix/factorizedNeighborhood.pdf Yehuda Koren, Robert Bell: Advances in Collaborative Filtering, Chapter 5 of the Recommender Systems Handbook, Springer, 2011. http://research.yahoo.net/files/korenBellChapterSpringer.pdf

Наследование: RatingCorrelationMatrix
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ComputeCorrelation ( IRatings ratings, EntityType entity_type, float>.IList entity_ratings, int j ) : float
ComputeCorrelation ( IRatings ratings, EntityType entity_type, int i, int j ) : float
ComputeCorrelations ( IRatings ratings, EntityType entity_type ) : void
Pearson ( int num_entities, float shrinkage ) : System

Constructor. Create a Pearson correlation matrix

Защищенные методы

Метод Описание
ComputeCorrelation ( double i_sum, double j_sum, double ii_sum, double jj_sum, double ij_sum, int n ) : float
GetDenominator ( double i_sum, double j_sum, double ii_sum, double jj_sum, int n ) : double
GetNumerator ( double i_sum, double j_sum, double ij_sum, int n ) : double

Описание методов

ComputeCorrelation() публичный Метод

public ComputeCorrelation ( IRatings ratings, EntityType entity_type, float>.IList entity_ratings, int j ) : float
ratings IRatings
entity_type EntityType
entity_ratings float>.IList
j int
Результат float

ComputeCorrelation() публичный Метод

public ComputeCorrelation ( IRatings ratings, EntityType entity_type, int i, int j ) : float
ratings IRatings
entity_type EntityType
i int
j int
Результат float

ComputeCorrelation() защищенный Метод

protected ComputeCorrelation ( double i_sum, double j_sum, double ii_sum, double jj_sum, double ij_sum, int n ) : float
i_sum double
j_sum double
ii_sum double
jj_sum double
ij_sum double
n int
Результат float

ComputeCorrelations() публичный Метод

public ComputeCorrelations ( IRatings ratings, EntityType entity_type ) : void
ratings IRatings
entity_type EntityType
Результат void

GetDenominator() защищенный Метод

protected GetDenominator ( double i_sum, double j_sum, double ii_sum, double jj_sum, int n ) : double
i_sum double
j_sum double
ii_sum double
jj_sum double
n int
Результат double

GetNumerator() защищенный Метод

protected GetNumerator ( double i_sum, double j_sum, double ij_sum, int n ) : double
i_sum double
j_sum double
ij_sum double
n int
Результат double

Pearson() публичный Метод

Constructor. Create a Pearson correlation matrix
public Pearson ( int num_entities, float shrinkage ) : System
num_entities int the number of entities
shrinkage float shrinkage parameter
Результат System