Re: Negative values of predictions in ALS.tranform

2016-12-16 Thread Manish Tripathi
Thanks a bunch. That's very helpful. On Friday, December 16, 2016, Sean Owen wrote: > That all looks correct. > > On Thu, Dec 15, 2016 at 11:54 PM Manish Tripathi > wrote: > >> ok. Thanks. So here is

Re: Negative values of predictions in ALS.tranform

2016-12-16 Thread Sean Owen
That all looks correct. On Thu, Dec 15, 2016 at 11:54 PM Manish Tripathi wrote: > ok. Thanks. So here is what I understood. > > Input data to Als.fit(implicitPrefs=True) is the actual strengths (count > data). So if I have a matrix of (user,item,views/purchases) I pass that

Re: Negative values of predictions in ALS.tranform

2016-12-15 Thread Manish Tripathi
ok. Thanks. So here is what I understood. Input data to Als.fit(implicitPrefs=True) is the actual strengths (count data). So if I have a matrix of (user,item,views/purchases) I pass that as the input and not the binarized one (preference). This signifies the strength. 2) Since we also pass the

Re: Negative values of predictions in ALS.tranform

2016-12-15 Thread Sean Owen
No, input are weights or strengths. The output is a factorization of the binarization of that to 0/1, not probs or a factorization of the input. This explains the range of the output. On Thu, Dec 15, 2016, 23:43 Manish Tripathi wrote: > when you say *implicit ALS *is*

Re: Negative values of predictions in ALS.tranform

2016-12-15 Thread Manish Tripathi
when you say *implicit ALS *is* factoring the 0/1 matrix. , are you saying for implicit feedback algorithm we need to pass the input data as the preference matrix i.e a matrix of 0 and 1?. * Then how will they calculate the confidence matrix which is basically =1+alpha*count matrix. If we don't

Re: Negative values of predictions in ALS.tranform

2016-12-15 Thread Sean Owen
No, you can't interpret the output as probabilities at all. In particular they may be negative. It is not predicting rating but interaction. Negative means very strongly not predicted to interact. No, implicit ALS *is* factoring the 0/1 matrix. On Thu, Dec 15, 2016, 23:31 Manish Tripathi

Re: Negative values of predictions in ALS.tranform

2016-12-15 Thread Manish Tripathi
Ok. So we can kind of interpret the output as probabilities even though it is not modeling probabilities. This is to be able to use it for binaryclassification evaluator. So the way I understand is and as per the algo, the predicted matrix is basically a dot product of user factor and item factor

Re: Negative values of predictions in ALS.tranform

2016-12-15 Thread Sean Owen
No, ALS is not modeling probabilities. The outputs are reconstructions of a 0/1 matrix. Most values will be in [0,1], but, it's possible to get values outside that range. On Thu, Dec 15, 2016 at 10:21 PM Manish Tripathi wrote: > Hi > > ran the ALS model for implicit

Negative values of predictions in ALS.tranform

2016-12-15 Thread Manish Tripathi
Hi ran the ALS model for implicit feedback thing. Then I used the .transform method of the model to predict the ratings for the original dataset. My dataset is of the form (user,item,rating) I see something like below: predictions.show(5,truncate=False) Why is the last prediction value