pub struct SamplingExplainer<M, K = IndependentMasker> { /* private fields */ }Expand description
Monte-Carlo Sampling SHAP. Samples random feature orderings and averages marginal contributions; the execution engine is shared with permutation SHAP because those are the defining samples of the Shapley distribution.
Implementations§
Source§impl<M> SamplingExplainer<M, IndependentMasker>
impl<M> SamplingExplainer<M, IndependentMasker>
pub fn new(model: M, background: Background) -> Self
Source§impl<M, K> SamplingExplainer<M, K>
impl<M, K> SamplingExplainer<M, K>
pub fn from_masker(model: M, masker: K) -> Self
pub fn with_nsamples(self, n: usize) -> Self
pub fn with_seed(self, s: u64) -> Self
pub fn with_antithetic(self, enabled: bool) -> Self
pub fn with_link(self, link: Link) -> Self
pub fn with_evaluation_config(self, c: EvaluationConfig) -> Self
Source§impl<M: Predict, K: Masker> SamplingExplainer<M, K>
impl<M: Predict, K: Masker> SamplingExplainer<M, K>
pub fn explain_with_uncertainty( &self, x: ArrayView2<'_, f64>, repeats: usize, ) -> Result<UncertainExplanation>
Trait Implementations§
Source§impl<M: Predict, K: Masker> Explainer for SamplingExplainer<M, K>
impl<M: Predict, K: Masker> Explainer for SamplingExplainer<M, K>
fn explain(&self, x: ArrayView2<'_, f64>) -> Result<Explanation>
Auto Trait Implementations§
impl<M, K> Freeze for SamplingExplainer<M, K>
impl<M, K> RefUnwindSafe for SamplingExplainer<M, K>where
M: RefUnwindSafe,
K: RefUnwindSafe,
impl<M, K> Send for SamplingExplainer<M, K>
impl<M, K> Sync for SamplingExplainer<M, K>
impl<M, K> Unpin for SamplingExplainer<M, K>
impl<M, K> UnsafeUnpin for SamplingExplainer<M, K>where
M: UnsafeUnpin,
K: UnsafeUnpin,
impl<M, K> UnwindSafe for SamplingExplainer<M, K>where
M: UnwindSafe,
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more