shapiq.imputer.Imputer¶
- class shapiq.imputer.Imputer(model, data, x=None, *, sample_size=100, categorical_features=None, random_state=None, verbose=False)[source]¶
-
Base class for Imputers.
Initializes the base imputer.
- Parameters:
model (
TypeVar(TModel)) – The model to explain as a callable function expecting a data points as input and returning the model’s predictions.data (
ndarray) – The background data to use for the explainer as a 2-dimensional array with shape(n_samples, n_features).x (
ndarray|None) – The explanation point to use the imputer on either as a 2-dimensional array with shape(1, n_features)or as a vector with shape(n_features,).sample_size (
int|None) – The number of samples to draw from the background data. Defaults to100but is usually overwritten in the subclasses.categorical_features (
list[int] |None) – A list of indices of the categorical features in the background data.random_state (
int|None) – The random state to use for sampling. Defaults toNone.verbose (
bool) – A flag to enable verbose imputation, which will print a progress bar for model evaluation. Note that this can slow down the imputation process. Defaults toFalse.
- model: TModel¶
The model to impute missing values for.