PDPbox icon indicating copy to clipboard operation
PDPbox copied to clipboard

Cannot use pdp.pdp_isolate() on multiclass problem

Open pvester opened this issue 5 years ago • 0 comments

I have a random forrest model that gives output in the format array([[0, 1]], dtype=uint8) or array([[1, 0]], dtype=uint8). I cant figure out how to use pdp_isolate... my code is here and erorr message:

CODE: from matplotlib import pyplot as plt from pdpbox import pdp, get_dataset, info_plots

pdp_inc = pdp.pdp_isolate(model=model, dataset=pd.DataFrame(features.iloc[0]).T, model_features=features.columns.tolist(), feature='r1') pdp.pdp_plot(pdp_inc, 'SCI_Mainframe') plt.show()

ERROR: TypeError: list indices must be integers or slices, not tuple

I dont know what to do. I have spend a couple hours looking for soluytion whitout luck

pvester avatar Oct 09 '19 15:10 pvester