Closed timnon closed 7 years ago
Could you check your commend line? In my case, -method mcmc won't save model, and the program will be terminated automatically like:
WARNING: -save_model enabled only for SGD and ALS.
I tried using -method als, the model looks good to me.
./bin/libFM -task r -method als -train train.libfm -test train.libfm -iter 10 -dim ‘0,0,1’ -out output.libfm -save_model model.libfm
I can always get a satisfied result that the multiplication of the two is larger than 1, such as:
#pairwise interactions Vj,f
7.79554
0.128279
BTW, there is one trick in libfm that the predictions will be replaced by MAX value when the predictions are larger than MAX.
Thanks for the quick reply!
Switching to -method mcmc works for me! But why does -method mcmc not? I can also save the model with -method mcmc using the command from above:
libFM -task r -method mcmc -train train.libfm -test train.libfm -iter 10 -dim ‘0,0,1’ -out output.libfm -save_model model.libfm
Using -method sgd gives me the following error (i guess this is another problem):
Loading meta data...
Assertion failed: ((lr.size() == 1) || (lr.size() == 3)), function main, file libfm.cpp, line 386.
./run.sh: line 1: 13540 Abort trap: 6 ../libfm/bin/libFM -task r -method sgd -train train.libfm -test train.libfm -iter 10 -dim ‘0,0,1’ -out output.libfm -save_model model.libfm
The original design doesn't consider the saving function. The current saving function is later added. In general, the mcmc method is supposed to save the modeling parameters for each iteration. In other words, 100 iterations will save the modeling parameters 100 times, which is quite big if we use a large dimensional dataset. Instead, libfm selects to make the predictions on-the-fly so it won't produce a big modeling file (or occupies too much memory).
Add -learn_rate 0.1 could solve the sgd issue.
thanks!
the result of output is always 0 or 1,but it want the predict value in 0 to 1,how about ?
Please enlighten me, i tried the simplest possible example:
File
train.libfm
is set toand ran it using
Hence, only the pairwise interactions should be used and its dimension is 1. The regression shows a perfect fit (as expected). However, looking at
model.libfm
gives meMy expectations is that the first number times the second number (the pairwise interaction of the two features) should be 1 (the target of the regression), but it is always clearly sth else. Tried the same trivial example with fastFM and it behaved as expected.