hi. I tried to figure out how you calcualte pearson correlation, but it looks
like you use this formula:

sumXY / sqrt(sumX2 * sumY2)

where sumXY = sumXY - meanY * sumX;
sumX2 = sumX2 - meanX * sumX;
sumY2 = sumY2 - meanY * sumY;

i don't really understand how you got these equations. could you explain it
to me? I thought pearson correlation would be like this

E(x_i-meanX)(y_i-meanY) / sdX*sdY

for my project I would need to get sample correlation coefficient which
would be something like this:

sum(x_i-meanX)(y_i-meanY)/(N-1)

thanks a lot. 


srowen wrote:
> 
> Yes. Look at PearsonCorrelationSimilarity. It implements
> ItemSimilarity so it can compute a Pearson correlation between ratings
> for two items. Pearson is the covariance divided by the product of the
> standard deviations. So, just multiply the similarity value you get by
> the standard deviations of the items' preference values.
> 
> The variance of each item's preference values is simply the square of
> the standard deviation, if that's what you mean.
> 
> You can use RunningAverageAndStdDev to help compute standard deviation
> if you like.
> 
> On Thu, Nov 26, 2009 at 3:14 PM, jamborta <[email protected]> wrote:
>>
>> hi guys,
>> just wondering if you have a method implemeted which would calculate the
>> covariance between two items. and the variance of an item. I looked
>> itemSimilarities but that one does something different.
>>
>> thanks
>> Tama
>> --
>> View this message in context:
>> http://old.nabble.com/Mahout-Taste-covariance-between-two-items-tp26530825p26530825.html
>> Sent from the Mahout User List mailing list archive at Nabble.com.
>>
>>
> 
> 



-- 
View this message in context: 
http://old.nabble.com/Mahout-Taste-covariance-between-two-items-tp26530825p26535849.html
Sent from the Mahout User List mailing list archive at Nabble.com.

Reply via email to