Expand description
§Outlier detection
This crate provides implementations of time series outlier detection, the problem of determining whether one time series behaves differently to others in a group. (This is different to anomaly detection, which aims to determine if one or more samples appears to be different within a time series).
Two implementations are planned:
- DBSCAN: implemented
- Median Absolute Difference (MAD): not yet implemented (see GitHub issue)
§Example
use augurs::outlier::{OutlierDetector, DbscanDetector};
// Each slice inside `data` is a time series.
// The third one behaves differently at indexes 2 and 3.
let data: &[&[f64]] = &[
&[1.0, 2.0, 1.5, 2.3],
&[1.9, 2.2, 1.2, 2.4],
&[1.5, 2.1, 6.4, 8.5],
];
let detector = DbscanDetector::with_sensitivity(0.5)
.expect("sensitivity is between 0.0 and 1.0");
let processed = detector.preprocess(data)
.expect("input data is valid");
let outliers = detector.detect(&processed)
.expect("detection succeeds");
assert_eq!(outliers.outlying_series.len(), 1);
assert!(outliers.outlying_series.contains(&2));
assert!(outliers.series_results[2].is_outlier);
assert_eq!(outliers.series_results[2].scores, vec![0.0, 0.0, 1.0, 1.0]);
Structs§
- Band
- A band indicating the min and max value considered outlying at each timestamp.
- Dbscan
Data - Preprocessed data for the DBSCAN algorithm.
- Dbscan
Detector - A detector for outliers using a 1 dimensional DBSCAN algorithm.
- MADData
- The preprocessed data for the MAD detector.
- MADDetector
- A detector using the Median Absolute Deviation (MAD) to detect outliers.
- Outlier
Interval - A single outlier interval.
- Outlier
Intervals - A list of outlier intervals for a single series.
- Outlier
Output - The result of applying an outlier detection algorithm to a time series.
- Series
- A potentially outlying series.
Enums§
- Error
- Errors that can occur when working with outlier detection algorithms.
Traits§
- Outlier
Detector - An outlier detection algorithm.