pywFM icon indicating copy to clipboard operation
pywFM copied to clipboard

Model cannot be saved when k2 = 0

Open jilljenn opened this issue 7 years ago • 5 comments

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: 

jilljenn avatar Feb 09 '18 05:02 jilljenn

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

Thank you for the report!

jfloff avatar Feb 10 '18 01:02 jfloff

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

jilljenn avatar Feb 19 '18 12:02 jilljenn

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

CherChen0 avatar Oct 11 '19 09:10 CherChen0

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 :)

jfloff avatar Oct 14 '19 09:10 jfloff

Sorry, what does "MWE" mean?

CherChen0 avatar Oct 17 '19 07:10 CherChen0