ESDDetector<T>
Models & Types · AiDotNet.AnomalyDetection.Statistical
Detects anomalies using ESD-based (Extreme Studentized Deviate) scoring.
Inheritance: ModelBase<T, Matrix<T>, Vector<T>> → AnomalyDetectorBase<T> → ESDDetector<T>
Implements: IGeneratedParameterRegistrar<T>
For Beginners
This detector uses standardized residuals (the core statistic from the ESD test) to identify outliers. Points that deviate significantly from the mean (measured in standard deviations) are flagged as anomalies.
How It Works
Implementation: This is a scoring-based approach following industry standards:
- Compute the ESD statistic for each point: max|x - mean| / std across features
- Use contamination-based threshold (top X% of scores are anomalies)
- CriticalValue property available (computed from training sample size, valid for same n)
When to use:
- When you expect multiple outliers
- Data is approximately normally distributed
- You want Z-score style detection with contamination-based thresholding
Industry Standard Defaults:
- Alpha (significance level): 0.05 (5%) - used for critical value computation
- Contamination: 10% of data flagged as outliers
Reference: Rosner, B. (1983). “Percentage Points for a Generalized ESD Many-Outlier Procedure.” Technometrics.
Constructors
| Constructor | Summary |
|---|---|
ESDDetector(double alpha, int? maxOutliers, double contamination, int randomSeed) |
Creates a new ESD anomaly detector. |
Properties
| Property | Summary |
|---|---|
T CriticalValue { get; } |
Gets the ESD critical value computed during fitting. |
double Alpha { get; } |
Gets the significance level (alpha) for the test. |
int? MaxOutliers { get; } |
Gets the maximum number of outliers to detect. |
Methods
| Method | Summary |
|---|---|
Vector<T> ScoreAnomalies(Matrix<T> X) |
|
void Fit(Matrix<T> X) |