pub struct IsolationForestDetector { /* private fields */ }Expand description
Isolation Forest multivariate anomaly detector.
Recursively partitions data along random features and split values. Anomalous points are isolated in fewer splits (shorter path length). Score is normalized to [0, 1] where values close to 1 indicate anomalies.
§Deterministic Seeding
The forest uses a fixed base seed (42) combined with the tree index to derive per-tree PRNG streams. This makes results fully deterministic for a given dataset, which is valuable for reproducibility and testing.
The seed does not incorporate data shape (n_series, n_timestamps) because the subsample selection and split decisions are already conditioned on the actual data values. Adding shape to the seed would change results when the same logical dataset is padded or truncated, without improving detection quality.
If caller-controlled seeding is needed (e.g. for ensemble
diversity), a seed parameter can be added to the constructor
in a future release.
Implementations§
Trait Implementations§
Source§impl MultivariateAnomalyDetector for IsolationForestDetector
impl MultivariateAnomalyDetector for IsolationForestDetector
Source§fn fit(&mut self, ctx: &MultiSeriesContext) -> Result<(), MultivariateError>
fn fit(&mut self, ctx: &MultiSeriesContext) -> Result<(), MultivariateError>
Source§fn detect(
&self,
ctx: &MultiSeriesContext,
) -> Result<Vec<MultivariateAnomalyScore>, MultivariateError>
fn detect( &self, ctx: &MultiSeriesContext, ) -> Result<Vec<MultivariateAnomalyScore>, MultivariateError>
Auto Trait Implementations§
impl Freeze for IsolationForestDetector
impl RefUnwindSafe for IsolationForestDetector
impl Send for IsolationForestDetector
impl Sync for IsolationForestDetector
impl Unpin for IsolationForestDetector
impl UnsafeUnpin for IsolationForestDetector
impl UnwindSafe for IsolationForestDetector
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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