-
Notifications
You must be signed in to change notification settings - Fork 332
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
PermutationImportance error with XGBoost and NaNs - ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
(with a fix)
#262
Comments
If you go down that route, you should also check to see if the model is also a pipeline with an imputer. |
Or maybe the easy first step is to pass an argument to |
I'll note that with a fresh install of a conda environment, I still get the above issue and using the work-around I posted, it works ok. These are my versions using
|
I have completely the same problem, is there any fix or solution? |
I'm looking at this as well as I'm having the same issue. I don't understand the case against having It's pretty obvious that the provided data to the model has to be similar as what the model was trained on. So I don't see why we need to do any input validation here. I can make a PR but I'd like to hear thoughts from a contributor on this. |
I will pick up the issue |
Using the current version of
XGBoost
andELI5
if I addNaN
values toX
, whilstshow_weights
works finePermutationImportance
throws an error:To recreate:
The call to
check_array
is usingsklearn
's constraints and disallowsNaN
. XGBoost is ok withNaN
. My modification (monkey patched here for easy testing) is to callcheck_array(X, force_all_finite=False)
:It might be wise to try testing for the use of
XGB
vssklearn
and thenforce_all_finite
could be flipped to preserve thesklearn
interpretation?The text was updated successfully, but these errors were encountered: