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

Code generated for XGBoost models return error scores when feature input include zero which result in xgboost "missing" #187

Closed
crystaldan opened this issue Mar 27, 2020 · 2 comments

Comments

@crystaldan
Copy link

I’m try using m2cgen to generate js code for XGBoost model,but find that if the feature input include zero,the result which calculate by generated js has a big difference with the result which predicted by model. For example, if the feature input is [0.4444,0.55555,0.3545,0.22333],the result which calculate by generated js equals the result which predicted by model,but if the feature input is [0.4444,0,0,0.22333],the result which calculate by generated js will be very different from the result which predicted by model,maybe one result is 0.22 ,the other one result is 0.04。After we validate by demo,we find that m2cgen not process “missing” condition. when xgboost result in “missing”, m2cgen will process it as “yes”

@izeigerman
Copy link
Member

izeigerman commented Mar 27, 2020

@crystaldan thanks for reporting the issue.

Can you please provide some steps to reproduce this behavior?

If I recall the notion of the "missing" value in XGBoost correctly, then 0 - is not a missing value, 0 is just a zero value. "Missing" values are considered to be NaNs. Am I wrong here?

Are you sure you're not hitting the other issue with XGBoost - #168 ?

Thanks.

UPD: Have you tried passing the JavaScript NaN instead of 0?

@izeigerman
Copy link
Member

Closing this due to the lack of details and in a hope that this is a duplicate of #168. @crystaldan please feel free to reopen this if the problem persists in version 0.7.0 and onward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants