SauceCat / PDPbox

python partial dependence plot toolbox
http://pdpbox.readthedocs.io/en/latest/
MIT License
840 stars 129 forks source link

predict_proba() argument after ** must be a mapping, not NoneType #35

Closed flycloudking closed 6 years ago

flycloudking commented 6 years ago

Hi,

I just installed the latest version. I am running your tutorial script "pdpbox_binary_classification.ipynb".

When running step 1.2

fig, axes, summary_df = info_plots.actual_plot( model=titanic_model, X=titanic_data[titanic_features], feature='Sex', feature_name='gender' )

I got an error as below:

TypeError Traceback (most recent call last)

in () 1 fig, axes, summary_df = info_plots.actual_plot( ----> 2 model=titanic_model, X=titanic_data[titanic_features], feature='Sex', feature_name='gender' 3 ) ~/.local/lib/python3.6/site-packages/pdpbox/info_plots.py in actual_plot(model, X, feature, feature_name, num_grid_points, grid_type, percentile_range, grid_range, cust_grid_points, show_percentile, show_outliers, endpoint, which_classes, predict_kwds, ncols, figsize, plot_params) 289 # make predictions 290 # info_df only contains feature value and actual predictions --> 291 prediction = predict(X, **predict_kwds) 292 info_df = X[_make_list(feature)] 293 actual_prediction_columns = ['actual_prediction'] TypeError: predict_proba() argument after ** must be a mapping, not NoneType I tried a different model and got the same error here.
SauceCat commented 6 years ago

https://github.com/SauceCat/PDPbox/issues/22

flycloudking commented 6 years ago

Never mind, just adding 'predict_kwds={}' solved the problem

leodongdong commented 1 year ago

Sorry, I want to know add 'predict_kwds={}' to where? thank you

SauceCat commented 1 year ago

only three functions require this param: actual_plot, pdp_isolate, pdp_interact

leodongdong @.***> 于2023年3月16日周四 11:25写道:

Sorry, I want to know add 'predict_kwds={}' to where? thank you

— Reply to this email directly, view it on GitHub https://github.com/SauceCat/PDPbox/issues/35#issuecomment-1471234872, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADXNPFBFCBJTCRO364YXIBTW4KBZJANCNFSM4FQIZ4BA . You are receiving this because you commented.Message ID: @.***>