pub enum ShapError {
Show 16 variants
DimensionMismatch {
expected: String,
found: String,
},
InvalidFeatureIndex {
index: usize,
n_features: usize,
},
InvalidSampleIndex {
index: usize,
n_samples: usize,
},
InvalidOutputIndex {
index: usize,
n_outputs: usize,
},
EmptyData,
EmptyBackground,
InvalidConfiguration(String),
ModelError(String),
MaskerError(String),
NumericalError(String),
SolverError(String),
Unsupported(String),
AdditivityError {
expected: f64,
actual: f64,
difference: f64,
tolerance: f64,
},
MissingMetadata(String),
OutputDimensionMismatch {
expected: usize,
found: usize,
},
Other(String),
}Expand description
Errors that can occur while constructing or evaluating SHAP explainers.
Variants§
DimensionMismatch
Two or more arrays have incompatible dimensions.
InvalidFeatureIndex
A feature index is outside the valid feature range.
InvalidSampleIndex
A sample index is outside the valid sample range.
InvalidOutputIndex
An output index is outside the valid model-output range.
EmptyData
The supplied data contains no samples.
EmptyBackground
The supplied background dataset contains no samples.
InvalidConfiguration(String)
An invalid configuration was supplied to an explainer or component.
ModelError(String)
A model prediction failed.
MaskerError(String)
A masking operation failed.
NumericalError(String)
A numerical operation failed.
SolverError(String)
A linear-system or weighted least-squares solver failed.
Unsupported(String)
The requested functionality is not supported.
AdditivityError
An explanation failed the SHAP additivity check.
MissingMetadata(String)
A required feature name or other metadata item was missing.
OutputDimensionMismatch
An operation was requested with incompatible output dimensions.
Other(String)
An underlying error that does not have a more specific SHAP error type.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ShapError
impl<'de> Deserialize<'de> for ShapError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Error for ShapError
impl Error for ShapError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()