Repository navigation
Conversation
Tree-based models use decision rules of the form `x <= value` which are well-defined for infinite values. Currently `predict` rejects inputs containing infinity, but this is overly conservative. Add `"allow-inf"` option to `ensure_all_finite` in `check_array` / `validate_data`. When set, infinity is allowed but NaN is still rejected. Use `"allow-inf"` in `Forest._validate_X_predict` and `BaseDecisionTree._validate_X_predict` so that `RandomForest`, `DecisionTree`, and `ExtraTree` estimators accept infinite values at prediction time. This pull request includes code written with the assistance of AI. The code has **not yet been reviewed** by a human.
|
Thank you for opening your first pull request to scikit-learn! 🎉 To help get your contribution reviewed, please make sure that:
|
|
Hi @godofecht, thank you for your interest, but opening automated PRs for issues (without checking if they are actually ready for contribution yet) is not something we value in this community (see our automated contributions policy). If you want to help, please read our contribution guidelines, and after understanding our values maybe spend your credits on helping us with reviewing any of the >500 open PRs instead. |
|
I am going to ban this user, this seems like an automated thing that opens many PRs in scikit-learn and other repos, duplicates scikit-learn issues in a separate repo 😱. See PRs opened in scikit-learn: https://github.com/scikit-learn/scikit-learn/pulls?q=sort%3Aupdated-desc+is%3Apr+author%3Agodofecht+is%3Aclosed Duplicated scikit-learn issues in separate repo: https://github.com/flooooooooooow/flow/issues?q=sort%3Aupdated-desc%20is%3Aissue%20scikit-learn Also has a scikit-learn fork that looks like it's going to be automatically updated by agents based on all the feed-back that is available in our issue tracker: https://github.com/godofecht/flow-scikit |
Reference Issue
Fixes #34668
What does this implement/fix?
Tree-based models use decision rules of the form
x <= valuewhich are well-defined for infinite values. Currentlypredictrejects inputs containing infinity, but this is overly conservative.This PR adds an
"allow-inf"option toensure_all_finiteincheck_array/validate_data. When set, infinity is allowed but NaN is still rejected. It uses this option inForest._validate_X_predictandBaseDecisionTree._validate_X_predictso thatRandomForest,DecisionTree, andExtraTreeestimators accept infinite values at prediction time.Reproducer
This pull request includes code written with the assistance of AI.
The code has not yet been reviewed by a human.