aksnzhy / xlearn

High performance, easy-to-use, and scalable machine learning (ML) package, including linear model (LR), factorization machines (FM), and field-aware factorization machines (FFM) for Python and CLI interface.
https://xlearn-doc.readthedocs.io/en/latest/index.html
Apache License 2.0
3.08k stars 518 forks source link

why the model.out content is messy code #63

Open ghost opened 6 years ago

ghost commented 6 years ago

sorry, I think I make a mistake, everything is OK

ghost commented 6 years ago

I have another problem, when I run the code:

from future import absolute_import import xlearn as xl

ffm_model = xl.create_ffm()

ffm_model.setTrain('./data/train_ffm.txt') ffm_model.setValidate('./data/valid_ffm.txt')

param = {'task': 'binary', 'lr': 0.2, 'lambda': 0.002, 'nthread': 8, 'epoch': 10}

ffm_model.fit(param, './ffm_model.out')

ffm_model.setTest('./data/test_ffm.txt') ffm_model.predict('./ffm_model.out', './ffm_output.txt')

it has raise the error: Traceback (most recent call last): File "xlearn.py", line 3, in import xlearn as xl File "/home/huangzhanpeng/Download/criteo/kaggle_criteo_ctr_challenge-/xlearn.py", line 5, in ffm_model = xl.create_ffm() AttributeError: 'module' object has no attribute 'create_ffm'

but the code can run in jupyter notebook

aksnzhy commented 6 years ago

It's a strange error I have never met before. I will check this soon.

ghost commented 6 years ago

there is another strange thing that if not delete xlearn.pyc, while create another python script, it still raise the same error

johnwanggithub commented 5 years ago

@HuangZhanPeng 请问后来 'module' object has no attribute 'create_ffm' 这个问题怎么解决的,我也遇到了同样的问题,谢谢。

aksnzhy commented 5 years ago

@johnwanggithub 你能把 code 放上来吗,我帮你 check 一下。

ghost commented 5 years ago

@johnwanggithub 我删除了.pyc文件后就可以了