-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Follow force_all_finite for object dtype in check_array #13254
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
Follow force_all_finite for object dtype in check_array #13254
Conversation
Do you want to modify all estimators which are in this case as well? |
Question here: do we want to check for To be fully consistent, we should probably do that, since we check it for numeric data. But in practice, I suppose it will hardly ever come up (as opposed to np.nan in object dtype data), and checking it for object dtype is also much less efficient than checking it for float dtype. So from practical point of view, we could also just document it in |
Happy to not worry about inf in object dtype... |
…cikit-learn#13254)" This reverts commit 162d431.
…cikit-learn#13254)" This reverts commit 162d431.
Tries to resolve part of #12148.
Currently,
check_array
does not check for nan/inf when the data is object dtype. But eg in OneHotEncoder, this is actually needed, and there some additional custom code was added after callingcheck_array
. This PR basically moves that intocheck_array
.For now, I only check for
np.nan
, and not yetnp.inf
.