TimeSeriesIsolationForestOptions<T>

Options & Configuration · AiDotNet.Models.Options

Configuration options for Time Series Isolation Forest anomaly detection.

Inheritance: ModelOptions → RegressionOptions<T> → TimeSeriesRegressionOptions<T> → TimeSeriesIsolationForestOptions<T>

For Beginners

Isolation Forest works by randomly isolating observations. Anomalies are easier to isolate because they are “few and different” - they end up in shorter branches of the isolation trees.

For time series, we enhance this by considering:

  • Lag Features: How the current value relates to recent past values
  • Rolling Statistics: Moving averages, standard deviations
  • Seasonal Patterns: Accounting for regular patterns like daily/weekly cycles
  • Trend: Long-term direction of the data

This makes it effective for detecting:

  • Sudden spikes or drops (point anomalies)
  • Values that are unusual given the context (contextual anomalies)
  • Unusual patterns over time (collective anomalies)

How It Works

Time Series Isolation Forest extends the classic Isolation Forest algorithm to handle temporal data by incorporating lag features, rolling statistics, and seasonal decomposition.

Constructors

Constructor Summary
TimeSeriesIsolationForestOptions() Creates a new instance with default values.
TimeSeriesIsolationForestOptions(TimeSeriesIsolationForestOptions<T> other) Creates a copy of the specified options.

Properties

Property Summary
bool UseSeasonalDecomposition { get; set; } Gets or sets whether to decompose the series into trend and seasonal components.
bool UseTrendFeatures { get; set; } Gets or sets whether to include trend-based features.
double ContaminationRate { get; set; } Gets or sets the expected proportion of anomalies in the dataset.
int LagFeatures { get; set; } Gets or sets the number of lag features to include.
int NumTrees { get; set; } Gets or sets the number of isolation trees in the forest.
int RollingWindowSize { get; set; } Gets or sets the window size for rolling statistics (mean, std, min, max).
int? MaxDepth { get; set; } Gets or sets the maximum depth of each isolation tree.
int? SampleSize { get; set; } Gets or sets the number of samples to use when building each tree.