pub struct InterventionalTreeExplainer<'a> { /* private fields */ }Expand description
Exact interventional TreeSHAP using an explicit background distribution.
Unlike TreeExplainer, absent features are replaced from background rows
rather than integrated using training-path covers.
Implementations§
Source§impl<'a> InterventionalTreeExplainer<'a>
impl<'a> InterventionalTreeExplainer<'a>
pub fn new(model: &'a TreeEnsemble, background: Background) -> Self
pub fn with_max_features(self, max_features: usize) -> Self
Sourcepub fn explain_probability(&self, x: ArrayView2<'_, f64>) -> Result<Explanation>
pub fn explain_probability(&self, x: ArrayView2<'_, f64>) -> Result<Explanation>
Explains probabilities exactly under the supplied background. A one-output ensemble uses sigmoid; multiple outputs use softmax.
Sourcepub fn explain_binary_log_loss(
&self,
x: ArrayView2<'_, f64>,
targets: &[bool],
) -> Result<Explanation>
pub fn explain_binary_log_loss( &self, x: ArrayView2<'_, f64>, targets: &[bool], ) -> Result<Explanation>
Explains binary logistic loss for each sample’s target label.
Trait Implementations§
Source§impl Explainer for InterventionalTreeExplainer<'_>
impl Explainer for InterventionalTreeExplainer<'_>
fn explain(&self, x: ArrayView2<'_, f64>) -> Result<Explanation>
Auto Trait Implementations§
impl<'a> Freeze for InterventionalTreeExplainer<'a>
impl<'a> RefUnwindSafe for InterventionalTreeExplainer<'a>
impl<'a> Send for InterventionalTreeExplainer<'a>
impl<'a> Sync for InterventionalTreeExplainer<'a>
impl<'a> Unpin for InterventionalTreeExplainer<'a>
impl<'a> UnsafeUnpin for InterventionalTreeExplainer<'a>
impl<'a> UnwindSafe for InterventionalTreeExplainer<'a>
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