GMMDetector<T>
Models & Types · AiDotNet.AnomalyDetection.Probabilistic
Detects anomalies using Gaussian Mixture Models (GMM).
Inheritance: ModelBase<T, Matrix<T>, Vector<T>> → AnomalyDetectorBase<T> → GMMDetector<T>
Implements: IGeneratedParameterRegistrar<T>
For Beginners
GMM models data as a mixture of several Gaussian distributions. Points with low probability under this model are anomalies - they don’t fit well into any of the learned Gaussian clusters.
How It Works
The algorithm works by:
- Fit a mixture of k Gaussians using Expectation-Maximization
- For each point, compute its probability under the mixture model
- Points with low probability are anomalies
When to use:
- Data is a mixture of Gaussian clusters
- Different clusters have different shapes/sizes
- You need probabilistic anomaly scores
Industry Standard Defaults:
- Components: 3 (typical range 2-10)
- Covariance type: diagonal (uses variance per feature for stability)
- Contamination: 0.1 (10%)
Constructors
| Constructor | Summary |
|---|---|
GMMDetector(int nComponents, int maxIterations, double contamination, int randomSeed) |
Creates a new GMM anomaly detector. |
Properties
| Property | Summary |
|---|---|
int NComponents { get; } |
Gets the number of Gaussian components. |
Methods
| Method | Summary |
|---|---|
Vector<T> ScoreAnomalies(Matrix<T> X) |
|
void Fit(Matrix<T> X) |