AnomalyDetectorBase<T>

Base Classes ยท AiDotNet.AnomalyDetection

Base class for algorithmic anomaly detectors providing common functionality. Extends ModelBase to participate in the unified model framework (serialization, gradient computation, test generation).

Inheritance: ModelBase<T, Matrix<T>, Vector<T>> โ†’ AnomalyDetectorBase<T>

Implements: IAnomalyDetector<T>

Known derived types: ABODDetector<T>, ARIMADetector<T>, AnoGANDetector<T>, AnomalyTransformerDetector<T>, AutoencoderDetector<T>, AveragingDetector<T>, BayesianDetector<T>, CBLOFDetector<T>, COFDetector<T>, COPODDetector<T>, ChiSquareDetector<T>, DAGMMDetector<T>, DBSCANDetector<T>, DeepSVDDDetector<T>, DevNetDetector<T>, DixonQTestDetector<T>, ECODDetector<T>, ESDDetector<T>, EllipticEnvelopeDetector<T>, ExtendedIsolationForest<T>, FairCutForest<T>, FastABODDetector<T>, FeatureBaggingDetector<T>, GANomalyDetector<T>, GESDDetector<T>, GMMDetector<T>, GrubbsTestDetector<T>, HDBSCANDetector<T>, HampelDetector<T>, INFLODetector<T>, IQRDetector<T>, IsolationForest<T>, KMeansDetector<T>, KNNDetector<T>, KernelPCADetector<T>, LDCOFDetector<T>, LOCIDetector<T>, LSCPDetector<T>, LSTMDetector<T>, LoOPDetector<T>, LocalOutlierFactor<T>, MADDetector<T>, MCDDetector<T>, MatrixProfileDetector<T>, MaximumDetector<T>, ModifiedZScoreDetector<T>, MovingAverageDetector<T>, NBEATSDetector<T>, OCSVMDetector<T>, OneClassSVM<T>, PCADetector<T>, PercentileDetector<T>, RandomSubspaceDetector<T>, RobustPCADetector<T>, SCiForest<T>, SOSDetector<T>, STLDetector<T>, SUODDetector<T>, SeasonalHybridESDDetector<T>, SpectralResidualDetector<T> (+3 more)

For Beginners

This base class provides shared functionality for all machine learning-based anomaly detectors. It handles common tasks like parameter validation, threshold computation, and distance calculations, allowing specific algorithms (like Isolation Forest or LOF) to focus on their unique detection logic.

How It Works

Industry Standard Defaults:

  • Contamination: 0.1 (10%) - the expected proportion of anomalies
  • Random Seed: 42 - for reproducibility

Properties

Property Summary
ILossFunction<T> DefaultLossFunction { get; }
T Threshold { get; }
bool IsFitted { get; }

Methods

Method Summary
IFullModel<T, Matrix<T>, Vector<T>> DeepCopy()
IFullModel<T, Matrix<T>, Vector<T>> WithParameters(Vector<T> parameters)
Vector<T> Predict(Matrix<T> X)
Vector<T> ScoreAnomalies(Matrix<T> X)
void Fit(Matrix<T> X)
void Train(Matrix<T> input, Vector<T> expectedOutput) Trains the anomaly detector.