evalml.model_understanding.partial_dependence

evalml.model_understanding.partial_dependence(pipeline, X, feature, grid_resolution=100)[source]

Calculates partial dependence.

Parameters
  • pipeline (PipelineBase or subclass) – Fitted pipeline

  • X (ww.DataTable, pd.DataFrame, np.ndarray) – The input data used to generate a grid of values for feature where partial dependence will be calculated at

  • feature (int, string) – The target features for which to create the partial dependence plot for. If feature is an int, it must be the index of the feature to use. If feature is a string, it must be a valid column name in X.

Returns

DataFrame with averaged predictions for all points in the grid averaged

over all samples of X and the values used to calculate those predictions. The dataframe will contain two columns: “feature_values” (grid points at which the partial dependence was calculated) and “partial_dependence” (the partial dependence at that feature value). For classification problems, there will be a third column called “class_label” (the class label for which the partial dependence was calculated). For binary classification, the partial dependence is only calculated for the “positive” class.

Return type

pd.DataFrame