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

info_plots.actual_plot() got an error #60

Closed
fenxouxiaoquan opened this issue Dec 6, 2019 · 2 comments
Closed

info_plots.actual_plot() got an error #60

fenxouxiaoquan opened this issue Dec 6, 2019 · 2 comments

Comments

@fenxouxiaoquan
Copy link

when i execute the follow code just like binary_classification tutorial:
"""
fig, axes, summary_df = info_plots.actual_plot(
model=titanic_model, X=titanic_data[titanic_features], feature=['Embarked_C', 'Embarked_S', 'Embarked_Q'],
feature_name='embarked'
)
"""
and got follow error:
"""
TypeError: predict_proba() argument after ** must be a mapping, not NoneType
"""
i also tried lgb.LGBMClassifier and lgb raw model on my own data but got same error.
is there anyone knows how to fix it?

@vickiwickinger
Copy link

Hi,

the error message points to the following line in the source code
prediction = predict(X, **predict_kwds)
I just changed this line to prediction = predict(X) and then it worked again. Probably the scikit API changed in recent updated and it's not possible anymore to overload an additional None value.

@mfgray
Copy link

mfgray commented Apr 22, 2020

I ran in to this issue too. The info_plots.actual_plot() has the keyword argument predict_kwds which has the default value None, which seems to be causing the error with the argument unpacking (**). I was getting the same error.
"""
predict() argument after ** must be a mapping, not NoneType
"""

I was able to get it to work by passing in an empty set as the keyword argument. I.e. when calling actual_plot pass in the following keyword arg:
predict_kwds={}

Looking at the git commits it looks like the author had recently changed the default from an empty set to None.

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

No branches or pull requests

4 participants