Saltar al contenido principal

RegressionPartialDependence

GlobalExplainer
DashAI.back.explainability.explainers.RegressionPartialDependence

Partial dependence curves for regression models.

For each numeric feature, sweeps a grid of values, replaces the feature with each grid value across the test set and averages the model's predictions, showing the marginal effect of the feature on the predicted value. Model agnostic (only predict is queried); assumes features are not strongly correlated.

References

Parameters

grid_resolution : integer, default=50
Number of equally spaced grid points per feature.
lower_percentile : number, default=0.05
Lower percentile of the feature values used as grid start.
upper_percentile : number, default=0.95
Upper percentile of the feature values used as grid end.

Methods

explain(self, dataset)

Defined on RegressionPartialDependence

Compute partial dependence curves on the test split.

Parameters

dataset : Tuple[DatasetDict, DatasetDict]
A (x, y) pair where each element has at least a "test" split.

Returns

dict
Mapping from feature name to {"grid_values", "average"}, plus a "metadata" entry with the output column name.

plot(self, explanation: dict) -> List[DashAI.back.core.artifacts.GroupedArtifacts]

Defined on RegressionPartialDependence

Create a grouped artifact with one line plot group per feature.

Parameters

explanation : dict
Output of :meth:explain.

Returns

List[GroupedArtifacts]
A single grouped artifact whose groups are one plotly curve per numeric feature.

get_schema(cls) -> dict

Defined on ConfigObject

Generates the component related Json Schema.

Returns

dict
Dictionary representing the Json Schema of the component.

validate_and_transform(self, raw_data: dict) -> dict

Defined on ConfigObject

It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.

Parameters

raw_data : dict
A dictionary with the data provided by the user to initialize the model.

Returns

dict
A validated dictionary with the necessary objects.

Compatible with