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

Is there a more detailed sklearn api? #291

Open Skyexu opened 5 years ago

Skyexu commented 5 years ago

I can't find some function like fm.disableNorm() or .cv() in sklearn api,
does it work ,when set fold below?

fm_regressor = xl.FMModel(task='reg', metric='rmse', epoch=500, k=4, stop_window=10, lr=0.0001, reg_lambda=0.01,fold=5)

thank u

ankane commented 4 years ago

Hey @Skyexu, there's a parameter in the fit method for disableNorm and other options.

model.fit(X, y, is_instance_norm=False)

https://github.com/aksnzhy/xlearn/blob/e03f08ab22779ce13d9b08ac895ef5ba18fb16ef/python-package/xlearn/_sklearn.py#L187-L189

There doesn't appear to be a cv method.

Edit: You can reference the underlying model with model._XLearnModel.cv(...), but I imagine this could break between versions.

Skyexu commented 4 years ago

@ankane ok thank u 😁