with each repetition biased matrix factotirzation method provide different results on the same dataset

44 views
Skip to first unread message

hancho80

unread,
Oct 10, 2016, 1:30:46 PM10/10/16
to MyMediaLite
Hello,

I'm using rating prediction file in command prompt, with movielens 10m dataset, in order to generate prediction for single user.


My command that I used is:

rating_prediction --test-file=test.dat --prediction-file=prediction.txt --recommender=BiasedMatrixFactorization --file-format=movielens_1m --training-file=ratings.dat --data-dir=ml-10m --test-no-ratings

I added in ratings.dat file (movielens dataset) twenty ratings that the target user provided to the system.


every time when I repeat the procedure I get a different prediction in .txt file.


if my method of using rating_prediction.exe file is correct (in order to get prediction), do you know the reason why biased matrix factorization method generate different prediction with each repetition?

Thanks in advance

Zeno Gantner

unread,
Oct 10, 2016, 3:44:37 PM10/10/16
to mymed...@googlegroups.com

Hi,

The matrix factorization methods are initialized randomly, so different runs will yield different results.

You can provide --random-seed=N (where N is an integer) for repeatable behavior.

Let me know if you have further questions.

Z.


--
You received this message because you are subscribed to the Google Groups "MyMediaLite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mymedialite+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

hancho80

unread,
Apr 4, 2017, 3:56:15 PM4/4/17
to MyMediaLite
Hi,

excuse me for this question that may not be theme of mymedialite system, but in general, but I could not find a reason why the  matrix factorization methods are initialized randomly. Is it because of stochastic gradient descent method that is used in mymedialite matrix factorization algorithms, or it is initialized randomly in general on all  methods of matrix factorization (classic SVD with imputation,Funk SVD, BMF, SVD ++)?. Can you explain why it is randomly, or provide me literature? I read many literature but not understand why. Thanks in advance.

Regards,

Asmir
To unsubscribe from this group and stop receiving emails from it, send an email to mymedialite...@googlegroups.com.

Zeno Gantner

unread,
Apr 5, 2017, 5:08:32 AM4/5/17
to mymed...@googlegroups.com
Hello, 


Am 04.04.2017 9:56 nachm. schrieb "hancho80" <hanc...@gmail.com>:
Hi,

excuse me for this question that may not be theme of mymedialite system, but in general, but I could not find a reason why the  matrix factorization methods are initialized randomly. Is it because of stochastic gradient descent method that is used in mymedialite matrix factorization algorithms, or it is initialized randomly in general on all  methods of matrix factorization (classic SVD with imputation,Funk SVD, BMF, SVD ++)?. Can you explain why it is randomly, or provide me literature? I read many literature but not understand why. Thanks in advance.

Just imagine what would happen if you initialized all factors to zero or other constants. How would the gradients look like, or how would the coordinate descent updates look like? 

Note that this is different from training standard linear models like linear or logistic regression using SGD: there you can initialize the parameters to zero, because their counterparts, the features, have diverse values. 

In matrix factorization, the user and item features are each other's counterparts. They are (usually) latent features/hidden variables. Random initialization ensures that they have diverse values from the beginning on, so that the training algorithm can "figure out" that the different dimensions/factors represent different traits. 

I hope that helps. 

Cheers, 
   Z. 

hancho80

unread,
Apr 13, 2017, 8:54:44 AM4/13/17
to MyMediaLite
Hello Zeno,

Fisrt thanks for fast reply and for your help to explain me matrix factorization process.

Now I think I understand (I hope so) why matrix factorization process is initialized randomly.

 It is because of SGD process, that works on the basis of the machine learning process, where alghoritm generate the error in the train / test repeated steps for every rating in the rating set, and that error is then  used to update user feature values and item feature values, in order to reduce global RMSE. And given that it is a process of machine learning, starting point ( order of the rating set) is never the same so machine can ''figure out'' latent factors?

There is another thing
that is unclear to me. You mentioned thatmatrix factorization methods are initialized randomly, is that true for all methods (classic SVD without SGD) or only for SGD alghorithm (funk SVD)? SGD first initialized matrices, then update them, is that initialization also random or only within computation error and update process?

Thanks in advance,

Best regards,

Asmir

Zeno Gantner

unread,
Aug 2, 2017, 4:44:47 PM8/2/17
to mymed...@googlegroups.com
Initialization is random, but you set the random seed to get repeatability (e.g. for debugging).

Sorry for the late response. 

Cheers,  Z.

--
You received this message because you are subscribed to the Google Groups "MyMediaLite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mymedialite+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages