jfloff / pywFM

pywFM is a Python wrapper for Steffen Rendle's factorization machines library libFM
https://pypi.python.org/pypi/pywFM
MIT License
250 stars 42 forks source link

Model cannot be saved when k2 = 0 #24

Open jilljenn opened 6 years ago

jilljenn commented 6 years ago

When the latent dimension is 0, libFM still performs training but the pywFM can't save the model.

Code:

fm = pywFM.FM(task='classification', num_iter=5, k2=0, rlog=False)

Error:

Traceback (most recent call last):
  File "fm_assist.py", line 34, in <module>
    model = fm.run(X_train, df_train['outcome'], X_test, df_test['outcome'])
  File "/Users/jilljenn/code/TF-recomm/venv/lib/python3.6/site-packages/pywFM/__init__.py", line 222, in run
    pairwise_interactions.append([float(x) for x in line.split(' ')])
  File "/Users/jilljenn/code/TF-recomm/venv/lib/python3.6/site-packages/pywFM/__init__.py", line 222, in <listcomp>
    pairwise_interactions.append([float(x) for x in line.split(' ')])
ValueError: could not convert string to float: 
jfloff commented 6 years ago

Could you provide a MWE so I can replicate better and try to debug?

Thank you for the report!

jilljenn commented 6 years ago

Sorry, the code was k2=0 (I edited) but yes, I can provide a complete MWE.

CherChen0 commented 4 years ago

Hello, I also met this problem, is it fixed?

jfloff commented 4 years ago

Could you guys use the example do get a MWE working? I'm sorry, at the moment I'm a bit swamped with work and every help is appreciated :)

CherChen0 commented 4 years ago

Sorry, what does "MWE" mean?