pub struct TreeExplainer<'a> { /* private fields */ }Expand description
Exact polynomial-time TreeSHAP for native TreeEnsemble models.
Implementations§
Source§impl<'a> TreeExplainer<'a>
impl<'a> TreeExplainer<'a>
pub fn new(model: &'a TreeEnsemble) -> Self
Sourcepub fn explain_with_base_margin(
&self,
x: ArrayView2<'_, f64>,
base_margin: ArrayView2<'_, f64>,
) -> Result<Explanation>
pub fn explain_with_base_margin( &self, x: ArrayView2<'_, f64>, base_margin: ArrayView2<'_, f64>, ) -> Result<Explanation>
Explains raw outputs with per-sample base margins replacing the model’s fixed base offset. Tree contributions are unchanged; only base values shift.
Trait Implementations§
Source§impl Explainer for TreeExplainer<'_>
impl Explainer for TreeExplainer<'_>
fn explain(&self, x: ArrayView2<'_, f64>) -> Result<Explanation>
Auto Trait Implementations§
impl<'a> Freeze for TreeExplainer<'a>
impl<'a> RefUnwindSafe for TreeExplainer<'a>
impl<'a> Send for TreeExplainer<'a>
impl<'a> Sync for TreeExplainer<'a>
impl<'a> Unpin for TreeExplainer<'a>
impl<'a> UnsafeUnpin for TreeExplainer<'a>
impl<'a> UnwindSafe for TreeExplainer<'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