SauceCat / PDPbox

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

Provided example actual_plot: TypeError: predict() argument after ** must be a mapping, not NoneType #71

Open quweining518 opened 4 years ago

quweining518 commented 4 years ago

fig, axes, summary_df = info_plots.actual_plot( model=ross_model, X=ross_data[ross_features], feature='SchoolHoliday', feature_name='SchoolHoliday' )


TypeError Traceback (most recent call last)

in 1 fig, axes, summary_df = info_plots.actual_plot( ----> 2 model=ross_model, X=ross_data[ross_features], feature='SchoolHoliday', feature_name='SchoolHoliday' 3 ) ~/Envs/ml3_t2/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() argument after ** must be a mapping, not NoneType
konradsemsch commented 3 years ago

I'm facing a very similar issue but giving me:

TypeError: predict_proba() argument after ** must be a mapping, not NoneType