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

fix: NaN mode max model export to code catboost#2104 #2105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pkhokhlov
Copy link

@pkhokhlov pkhokhlov commented May 29, 2022

Fix for issue #2104 where NaN mode Max models are incorrectly exported to Python and C++ code.

The problem is line 42 of catboost/catboost/libs/model/model_export/resources/apply_catboost_model.py:

binary_features[binary_feature_index] += 1 if (float_features[model.float_features_index[i]] > border) else 0

where if float_features[model.float_features_index[i]] is NaN, any comparison to a border will be false and therefore less than all borders. This is the opposite behavior of what NaN mode Max requires.

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

@pkhokhlov pkhokhlov marked this pull request as ready for review May 29, 2022 03:10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks! Looks good to me now :)

@Evgueni-Petrov-aka-espetrov
Copy link
Contributor

@arcadia-devtools Ship it!

@arcadia-devtools
Copy link
Collaborator

CLA already signed

@arcadia-devtools
Copy link
Collaborator

@Evgueni-Petrov-aka-espetrov, internal review request created: 2769533

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

Successfully merging this pull request may close these issues.

None yet

4 participants