jinlow / forust

A lightweight gradient boosted decision tree package.
https://jinlow.github.io/forust/
Apache License 2.0
56 stars 6 forks source link

Is there any plan to make forust model format compatible of xgboost? #105

Open testforvln opened 2 months ago

testforvln commented 2 months ago

I found that forust is the only crate in pure rust for xgboost. I've got some models trained in xgboost. It will be very convenient if forust can support xgboost-format-compatible models inference.

jinlow commented 2 months ago

I think it’s possible, forust saves more information than XGBoost with the final model. So would have to think through good defaults for the missing information.

jinlow commented 2 months ago

Would you be open to converting the models into the forust format using Python? Or are you looking for a pure rust implementation for the conversion? I have working code/functionality, for converting some XGBoost models into a forust model using Python. At which point the model could be saved, and then loaded and used with the forust rust API from then on.

testforvln commented 2 months ago

Would you be open to converting the models into the forust format using Python? Or are you looking for a pure rust implementation for the conversion? I have working code/functionality, for converting some XGBoost models into a forust model using Python. At which point the model could be saved, and then loaded and used with the forust rust API from then on.

It's OK to use Python to convert models.

testforvln commented 1 week ago

py_test_0.zip Hi @jinlow , I use the python function of forust._from_xgboost_model(), but the two models' predict results seem to diff too much from each other. Can you reproduce it? The test code is in the attachment.