Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for other operators in export_as_xgboost #106

Closed
catenamatteo opened this issue Aug 19, 2019 · 3 comments
Closed

support for other operators in export_as_xgboost #106

catenamatteo opened this issue Aug 19, 2019 · 3 comments

Comments

@catenamatteo
Copy link

Hello,
I'm trying to convert RankLib ensembles to xgboost using treelite. I can programmatically build an ensemble with treelite given RankLib .xml, commit, and then export_as_xgboost. Unfortunately, RankLib's split operator is "<=". While treelite seems to support this operator, when I try to export to xgboost the library complains that only the "<" operator is allowed. One way to bypass this issue is to convert every disequality in a "<" one, but this requires to change the sign of the thresholds, of the feature values, and to flip the tree. Not very practical.

Is there any particular reason for this limitation? Can I help in some way to fix this?

@hcho3
Copy link
Collaborator

hcho3 commented Aug 19, 2019

@catenamatteo This limitation is in XGBoost: XGBoost uses "<" exclusively. Is there a reason why you want to convert to XGBoost specifically?

@catenamatteo
Copy link
Author

the xgboost format seems to be accepted by many other libraries, in particular shap.

@hcho3
Copy link
Collaborator

hcho3 commented Aug 22, 2019

@catenamatteo Unfortunately, our hands are tied, you will need to convert your model to use "<" operator, if you want to export it to be used in XGBoost later. The use of "<" operator is hard-cored everywhere in the XGBoost codebase.

@hcho3 hcho3 closed this as completed Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants