Skip to main content

AutoExplainer

Struct AutoExplainer 

Source
pub struct AutoExplainer<M, K = IndependentMasker> { /* private fields */ }
Expand description

Automatic model-agnostic explainer selection with one shared configuration.

Exact SHAP is selected when the masker feature count is at most exact_threshold; otherwise Kernel SHAP is used. Native tree and linear models should still use their specialized explainers directly.

Implementations§

Source§

impl<M> AutoExplainer<M, IndependentMasker>

Source

pub fn new(model: M, background: Background) -> Self

Source§

impl<M, K> AutoExplainer<M, K>

Source

pub fn from_masker(model: M, masker: K) -> Self

Source

pub fn with_exact_threshold(self, features: usize) -> Self

Source

pub fn with_kernel_samples(self, samples: usize) -> Self

Source

pub fn with_seed(self, seed: u64) -> Self

Source

pub fn with_ridge(self, ridge: f64) -> Self

Source

pub fn with_evaluation_config(self, evaluation: EvaluationConfig) -> Self

Source§

impl<M, K: Masker> AutoExplainer<M, K>

Trait Implementations§

Auto Trait Implementations§

§

impl<M, K> Freeze for AutoExplainer<M, K>
where M: Freeze, K: Freeze,

§

impl<M, K> RefUnwindSafe for AutoExplainer<M, K>

§

impl<M, K> Send for AutoExplainer<M, K>
where M: Send, K: Send,

§

impl<M, K> Sync for AutoExplainer<M, K>
where M: Sync, K: Sync,

§

impl<M, K> Unpin for AutoExplainer<M, K>
where M: Unpin, K: Unpin,

§

impl<M, K> UnsafeUnpin for AutoExplainer<M, K>
where M: UnsafeUnpin, K: UnsafeUnpin,

§

impl<M, K> UnwindSafe for AutoExplainer<M, K>
where M: UnwindSafe, K: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<E> ExplainerExt for E
where E: Explainer,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V