pub struct ConditionalTabularMasker { /* private fields */ }Expand description
Empirical conditional tabular masker using nearest background rows on the currently present features. Categorical columns use exact-match distance; numerical columns use variance-scaled squared distance.
Implementations§
Source§impl ConditionalTabularMasker
impl ConditionalTabularMasker
pub fn new( background: Background, categorical_features: &[usize], neighbors: usize, ) -> Result<Self>
pub fn background(&self) -> &Background
pub fn neighbors(&self) -> usize
Trait Implementations§
Source§impl Clone for ConditionalTabularMasker
impl Clone for ConditionalTabularMasker
Source§fn clone(&self) -> ConditionalTabularMasker
fn clone(&self) -> ConditionalTabularMasker
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConditionalTabularMasker
impl Debug for ConditionalTabularMasker
Source§impl Masker for ConditionalTabularMasker
impl Masker for ConditionalTabularMasker
Source§fn n_features(&self) -> usize
fn n_features(&self) -> usize
Number of coalition features exposed to an explainer.
fn mask( &self, sample: ArrayView1<'_, f64>, present: &[bool], ) -> Result<Array2<f64>>
Source§fn n_input_features(&self) -> usize
fn n_input_features(&self) -> usize
Number of columns expected in model input samples. Read more
Source§fn attribution_data(&self, samples: ArrayView2<'_, f64>) -> Result<Array2<f64>>
fn attribution_data(&self, samples: ArrayView2<'_, f64>) -> Result<Array2<f64>>
Values stored on the feature axis of the resulting explanation.
Source§fn for_each_masked_batch(
&self,
sample: ArrayView1<'_, f64>,
present: &[bool],
visitor: &mut dyn FnMut(Array2<f64>) -> Result<()>,
) -> Result<()>
fn for_each_masked_batch( &self, sample: ArrayView1<'_, f64>, present: &[bool], visitor: &mut dyn FnMut(Array2<f64>) -> Result<()>, ) -> Result<()>
Visits model-input batches for one coalition. Read more
Source§fn streams_masked_batches(&self) -> bool
fn streams_masked_batches(&self) -> bool
Whether
Masker::for_each_masked_batch should be consumed directly
instead of participating in ordinary multi-coalition batching.Auto Trait Implementations§
impl Freeze for ConditionalTabularMasker
impl RefUnwindSafe for ConditionalTabularMasker
impl Send for ConditionalTabularMasker
impl Sync for ConditionalTabularMasker
impl Unpin for ConditionalTabularMasker
impl UnsafeUnpin for ConditionalTabularMasker
impl UnwindSafe for ConditionalTabularMasker
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