ValueError: Two-way partial dependence plots are not supported for pairs of continuous and categorical features

63 Views Asked by At

I am trying to get a two way pdp plot for pairs of continuous, and categorical features in Python.

But I get this error:ValueError:

Two-way partial dependence plots are not supported for pairs of continuous and categorical features.

My model is LGBM. and below is my code. Any advise?

model= lgb.LGBMRegressor(learning_rate=0.05)

model.fit(X,Y)

fig

pdp_display = PartialDependenceDisplay.from_estimator(
    model, 
    X, 
    [('categorical_feature', 'quantitative_feature')],  
    categorical_features = categorical_features_Boolean,
    grid_resolution=50,
)

plt.show

I prefer avoiding encoding my categorical variables as they have high cardinality.

I am expecting a two way pdp plot for pairs of continuous and categorical features.

But I get this error:ValueError:

Two-way partial dependence plots are not supported for pairs of continuous and categorical features.

It works well when my pairs are the same type. But when they are not the same, I get the error.Any advise?

0

There are 0 best solutions below