I am trying making a item-based recommendation using cosine similarity with MapReduce.
Here's the input set.
itemIdx_1, userIdx_1 itemIdx_1, userIdx_2 itemIdx_2, userIdx_1 itemIdx_3, userIdx_3 ...
How do I design with this input data?
To use cosine similarity, I guess the input should be like below,
(no preferences, so data'd be 0 or 1 assumedly) itemIdx_1 , [userIdx_1:1, userIdx_2:1, userIdx_3:0] itemIdx_2 , [userIdx_1:0, userIdx_2:1, userIdx_3:0] ItemIdx_3 , [userIdx_1:0, userIdx_2:0, userIdx_3:1] ...
But How do I compare each row using MapReduce?
Please help. I've been sick of this for like a week..