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.09k stars 519 forks source link

successfully training. but always fail when running 'model.predict()' #366

Closed zHaOshuAnGye closed 2 years ago

zHaOshuAnGye commented 3 years ago

hello, thx for your code! I am confused with a problem.

here is my code. `import xlearn as xl fm_model = xl.create_fm() fm_model.setTrain("./train.txt") fm_model.setValidate("./test.txt") fm_model.setTest("./test.txt") # Test data

param = {'task':'binary', 'lr':0.1,'epoch':200,'stop_window':5,'metric': 'auc','k':8}

fm_model.setTXTModel("./model.out") fm_model.fit(param, "./model.out") fm_model.setSigmoid() # Convert output to 0-1 fm_model.predict("./model.txt", "output.txt")

` I can run it successfully until the last line:"fm_model.predict("./model.txt", "output.txt")". When it is fitting, it can output validate dataset result. Validate set and test set in my case are the same one, I'm confused why it cann't running this line "fm_model.predict("./model.txt", "output.txt")".

zHaOshuAnGye commented 2 years ago

fm_model.fit(param, "./model.out") should be fm_model.fit(param, "./model.txt")