tabensemb.trainer.Trainer.cal_partial_dependence_2way#

method

Trainer.cal_partial_dependence_2way(x_feature: str, y_feature: str, grid_size: int = 10, percentile: int | float = 100, x_min: int | float | None = None, x_max: int | float | None = None, y_min: int | float | None = None, y_max: int | float | None = None, df: DataFrame | None = None, **kwargs) Tuple[ndarray, ndarray, ndarray][source]#

Calculate 2-way partial dependency. See the source code of plot_partial_dependence_2way() for its usage.

Parameters:
x_feature

A continuous feature.

y_feature

A continuous feature.

grid_size

The number of sequential values.

percentile

The percentile of the feature used to generate sequential values.

x_min

The lower limit of the generated sequential values of the first feature. It will override the left percentile.

x_max

The upper limit of the generated sequential values of the first feature. It will override the right percentile.

y_min

The lower limit of the generated sequential values of the second feature. It will override the left percentile.

y_max

The upper limit of the generated sequential values of the second feature. It will override the right percentile.

df

The tabular dataset.

kwargs

Other arguments for _bootstrap_fit(). The above grid_size, percentile, y_min, y_max are passed to it for the second feature.

Returns:
list

The grid of the first feature

list

The grid of the second feature

list

pdp values of each first-feature value and each second-feature value in grids.