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

Missing value handling #687

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

Missing value handling #687

wants to merge 14 commits into from

Conversation

mnwright
Copy link
Member

@mnwright mnwright commented Aug 24, 2023

This is a quick and dirty implementation of missing value handling as done by other packages such as xgboost, lightgbm and scikit-learn. When splitting a node, missing values are ignored for calculating an initial split criterium value (i.e., decrease of impurity). Then for the best split, the missings are tried in the left child node and in the right child node and the choice is made based again on the split criterium value. For prediction, this direction is saved as the "default" direction. If a missing occurs in prediction at a node where there is no default direction, it goes left.

Caveats:

  • So far only implemented for classification with the default (Gini) splitting, also not for probability=TRUE
  • Only missings in the predictors x are handled, not in the outcome y
  • Potential slow implementation, have to check computation speed
  • Dirty implementation with repetitive code and no shortcuts if no data is missing at all
  • Not well tested

@mnwright mnwright changed the title Draft missing value handling for classification Missing value handling Jul 2, 2024
@mnwright
Copy link
Member Author

mnwright commented Jul 3, 2024

Now this is also implemented for probability and regression. It's also better tested and faster (no impact if no missing data).

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

Successfully merging this pull request may close these issues.

None yet

1 participant