shap.maskers.Impute

class shap.maskers.Impute(data, method='linear')

This imputes the values of missing features using the values of the observed features.

Unlike Independent, Gaussian imputes missing values based on correlations with observed data points.

__init__(data, method='linear')

Build a Partition masker with the given background data and clustering.

Parameters:
datanumpy.ndarray, pandas.DataFrame or {“mean: numpy.ndarray, “cov”: numpy.ndarray} dictionary

The background dataset that is used for masking.

Methods

__init__(data[, method])

Build a Partition masker with the given background data and clustering.

load(in_file[, instantiate])

This is meant to be overridden by subclasses and called with super.

save(out_file)

Save the model to the given file stream.

classmethod load(in_file, instantiate=True)

This is meant to be overridden by subclasses and called with super.

We return constructor argument values when not being instantiated. Since there are no constructor arguments for the Serializable class we just return an empty dictionary.

save(out_file)

Save the model to the given file stream.