pub struct KernelExplainer<M, K = IndependentMasker> { /* private fields */ }Expand description
Kernel SHAP with Shapley-kernel weighted least squares and an exact efficiency constraint. Sampled coalitions are complement-paired.
Implementations§
Source§impl<M> KernelExplainer<M, IndependentMasker>
impl<M> KernelExplainer<M, IndependentMasker>
pub fn new(model: M, background: Background) -> Self
Source§impl<M, K> KernelExplainer<M, K>
impl<M, K> KernelExplainer<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_exact_threshold(self, n: usize) -> Self
pub fn with_ridge(self, ridge: f64) -> Self
pub fn with_solver(self, solver: KernelSolver) -> Self
pub fn with_evaluation_config(self, config: EvaluationConfig) -> Self
pub fn with_link(self, link: Link) -> Self
Trait Implementations§
Source§impl<M: Predict, K: Masker> Explainer for KernelExplainer<M, K>
impl<M: Predict, K: Masker> Explainer for KernelExplainer<M, K>
fn explain(&self, x: ArrayView2<'_, f64>) -> Result<Explanation>
Auto Trait Implementations§
impl<M, K> Freeze for KernelExplainer<M, K>
impl<M, K> RefUnwindSafe for KernelExplainer<M, K>where
M: RefUnwindSafe,
K: RefUnwindSafe,
impl<M, K> Send for KernelExplainer<M, K>
impl<M, K> Sync for KernelExplainer<M, K>
impl<M, K> Unpin for KernelExplainer<M, K>
impl<M, K> UnsafeUnpin for KernelExplainer<M, K>where
M: UnsafeUnpin,
K: UnsafeUnpin,
impl<M, K> UnwindSafe for KernelExplainer<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