pub struct LIME { /* private fields */ }Expand description
LIME (Local Interpretable Model-agnostic Explanations).
Explains predictions by fitting a simple interpretable model locally around the instance being explained.
§Algorithm
- Generate perturbed samples around the instance
- Get model predictions for each perturbation
- Weight samples by proximity to original instance
- Fit weighted linear model to the perturbations
- Return linear model coefficients as explanations
§Reference
- Ribeiro, M. T., et al. (2016). “Why Should I Trust You?”: Explaining the Predictions of Any Classifier. KDD.
Implementations§
Source§impl LIME
impl LIME
Sourcepub fn new(n_samples: usize, kernel_width: f32) -> Self
pub fn new(n_samples: usize, kernel_width: f32) -> Self
Create new LIME explainer.
§Arguments
n_samples- Number of perturbations to generate (default: 1000)kernel_width- Width of exponential kernel (default: 0.75)
pub fn n_samples(&self) -> usize
pub fn kernel_width(&self) -> f32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LIME
impl RefUnwindSafe for LIME
impl Send for LIME
impl Sync for LIME
impl Unpin for LIME
impl UnwindSafe for LIME
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more