pub struct GradientExplainer<M> { /* private fields */ }Expand description
Expected Gradients (Gradient SHAP) with background interpolation and optional Gaussian local smoothing.
Implementations§
Source§impl<M> GradientExplainer<M>
impl<M> GradientExplainer<M>
pub fn new(model: M, background: Background) -> Self
pub fn with_nsamples(self, n: usize) -> Self
pub fn with_seed(self, s: u64) -> Self
pub fn with_local_smoothing(self, s: f64) -> Self
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Limits gradient rows submitted to the autodiff backend in one call.
Source§impl<M: DifferentiablePredict> GradientExplainer<M>
impl<M: DifferentiablePredict> GradientExplainer<M>
Sourcepub fn explain_with_uncertainty(
&self,
x: ArrayView2<'_, f64>,
repeats: usize,
) -> Result<UncertainExplanation>
pub fn explain_with_uncertainty( &self, x: ArrayView2<'_, f64>, repeats: usize, ) -> Result<UncertainExplanation>
Repeats Expected Gradients with independent deterministic seeds and returns the standard error of the mean attribution.
Trait Implementations§
Source§impl<M: DifferentiablePredict> Explainer for GradientExplainer<M>
impl<M: DifferentiablePredict> Explainer for GradientExplainer<M>
fn explain(&self, x: ArrayView2<'_, f64>) -> Result<Explanation>
Auto Trait Implementations§
impl<M> Freeze for GradientExplainer<M>where
M: Freeze,
impl<M> RefUnwindSafe for GradientExplainer<M>where
M: RefUnwindSafe,
impl<M> Send for GradientExplainer<M>where
M: Send,
impl<M> Sync for GradientExplainer<M>where
M: Sync,
impl<M> Unpin for GradientExplainer<M>where
M: Unpin,
impl<M> UnsafeUnpin for GradientExplainer<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for GradientExplainer<M>where
M: 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