SauceCat / PDPbox

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

Class labels #65

Closed qweliant closed 1 year ago

qweliant commented 4 years ago

I am having trouble figuring out how pdpbox assigns class labels to multiclass plots for single feats

here is an code snippet im using for a target that is either yes, no , or unknown

feature = <feat>
pdp_isolated = pdp_isolate(
    model=xgbcl, 
    dataset=X_train_processed, 
    model_features=X_train_processed.columns, 
    feature=feature,
    num_grid_points=100
)

pdp_plot(
    pdp_isolated, 
    feature_name=feature, 
    center=True, 
    x_quantile=True, 
    ncols=2, 
    plot_lines=True, 
    frac_to_plot=100,
    which_classes=[0, 1], 
    plot_pts_dist=True
)

trans