Closed kkhuang1990 closed 7 years ago
I didn't understand what's the problem with the predictions - that's a correct result given the amount of train/test samples. I'm using 5 training samples and 2 test which are being predicted as 3.71 and 3.47.
What's the result that you were expecting?
PS: Kindly reminder that these are the results that libfm
outputs. This repo is just a wrapper.
Closing since it just seems a misinterpretation of the expected results. Reopen if you have any problems.
I ran your example code as follows
import pywFM import numpy as np import pandas as pd
features = np.matrix([
]) target = [5, 3, 1, 4, 5, 1, 5]
fm = pywFM.FM(task='regression', num_iter=1000, verbose=True)
model = fm.run(features[:5], target[:5], features[5:], target[5:]) print(model.predictions) print(model.weights)
and the predictions are not so good, like this: [3.71942, 3.4779] [-0.36734, -1.25636, 1.04973, -2.0381, -2.07228, 0.0822247, -0.202202, -1.26609, -2.40143, -0.568957, -2.13888, -1.41459, 0.36015, 0.787539, -0.303377] actually the GT is [1, 5]. I tried to implement with even more iterations and the result is still not so good. how about the result of your implementation.
thx