ibayer / fastFM

fastFM: A Library for Factorization Machines
http://ibayer.github.io/fastFM
Other
1.08k stars 204 forks source link

fm.predict gives nan values #126

Open chrisbangun opened 6 years ago

chrisbangun commented 6 years ago

Hi,

I follow the step-by-step provided in the test_ranking.py in order to use fastFM for ranking problem. Using my own dataset, the model returns nan prediction value.

fm = bpr.FMRecommender(n_iter=2000,
                           init_stdev=0.01, l2_reg_w=.5, l2_reg_V=.5, rank=2,
                           step_size=.002, random_state=11)

fm.fit(x_train_sp_matrix,compares)

y_pred = fm.predict(X_test)

the X_test is simply the copy of my training data. what would be the case where fm model returns nan? any help would really be appreciated. thanks

todor-markov commented 6 years ago

I have the same problem but with sgd.FMClassification

yushcs commented 6 years ago

Is there anyone know how to solve it?

ibayer commented 6 years ago

Unfortunately many issues can lead to nan predictions.

@todor-markov I would recomment to use use the als/mcmc solver instead.