MCDDetector<T>
Models & Types · AiDotNet.AnomalyDetection.Linear
Detects anomalies using Minimum Covariance Determinant (MCD).
Inheritance: ModelBase<T, Matrix<T>, Vector<T>> → AnomalyDetectorBase<T> → MCDDetector<T>
Implements: IGeneratedParameterRegistrar<T>
For Beginners
MCD is a robust method for estimating the center and spread of data. Unlike standard mean and covariance, MCD is resistant to outliers by finding the subset of points that minimizes the covariance determinant. Points far from this robust estimate are anomalies.
How It Works
The algorithm works by:
- Find the subset of h points with minimum covariance determinant
- Compute robust mean and covariance from this subset
- Compute Mahalanobis distances using robust estimates
- Points with large distances are anomalies
When to use:
- Data with outliers that corrupt standard statistics
- When you need robust location/scatter estimates
- Multivariate anomaly detection
Industry Standard Defaults:
- Support fraction: 0.5 (use 50% of data for robust estimate)
- Contamination: 0.1 (10%)
Reference: Rousseeuw, P.J. (1984). “Least Median of Squares Regression.” Rousseeuw, P.J., Driessen, K.V. (1999). “A Fast Algorithm for the Minimum Covariance Determinant Estimator.”
Constructors
| Constructor | Summary |
|---|---|
MCDDetector(double supportFraction, double contamination, int randomSeed) |
Creates a new MCD anomaly detector. |
Properties
| Property | Summary |
|---|---|
double SupportFraction { get; } |
Gets the support fraction. |
Methods
| Method | Summary |
|---|---|
Vector<T> ScoreAnomalies(Matrix<T> X) |
|
void Fit(Matrix<T> X) |