pub struct DataDriftDetector { /* private fields */ }Expand description
Detects feature-wise distribution drift on tabular data.
For each column, computes the KS statistic D and PSI, then takes the maximum across features. KS dominates when the shape of the distribution changes; PSI dominates when bin masses redistribute.
Implementations§
Source§impl DataDriftDetector
impl DataDriftDetector
Sourcepub fn new(threshold: f64) -> Self
pub fn new(threshold: f64) -> Self
Create a detector with the given threshold, 10 PSI bins, and epsilon = 1e-4.
Sourcepub fn detect(
&self,
baseline: ArrayView2<'_, f64>,
current: ArrayView2<'_, f64>,
) -> Result<DriftScore>
pub fn detect( &self, baseline: ArrayView2<'_, f64>, current: ArrayView2<'_, f64>, ) -> Result<DriftScore>
Run the detector. Inputs are (n_samples, n_features) and must share
n_features.
Auto Trait Implementations§
impl Freeze for DataDriftDetector
impl RefUnwindSafe for DataDriftDetector
impl Send for DataDriftDetector
impl Sync for DataDriftDetector
impl Unpin for DataDriftDetector
impl UnsafeUnpin for DataDriftDetector
impl UnwindSafe for DataDriftDetector
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
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