AnomalyDetector

AnomalyDetector

is an option for functions such as Classify that specifies an anomaly detector for them to include.

Details

  • Possible settings for AnomalyDetector include:
  • Noneuse no anomaly detector (default)
    AnomalyDetectorFunction[]use the specified anomaly detector
    Automaticcreate an anomaly detector from the available data
    LearnedDistribution[]create an anomaly detector from a learned distribution
  • The specified anomaly detector is typically used during model evaluation, not during model training.
  • When an anomalous example is encountered, Missing["Anomalous"] is returned instead of a classification or prediction result.
  • Classify[ClassifierFunction[],AnomalyDetectordetector] can be used to overwrite the anomaly detector of a particular classifier (and similarly for PredictorFunction[]).
  • Classify[ClassifierFunction[],AcceptanceThresholdt] can be used to overwrite the value of the rarer-probability threshold used by the anomaly detector.
  • ClassifierFunction[][example,AnomalyDetectordetector] can be used to temporarily overwrite the anomaly detector during a model evaluation.
  • ClassifierFunction[][example,AcceptanceThresholdt] can be used to temporarily overwrite the rarer-probability threshold value during a model evaluation.

Examples

Basic Examples  (3)

Create a classifier and specify that an anomaly detector should be included:

Evaluate the classifier on an non-anomalous input:

Evaluate the classifier on an anomalous input:

The "Probabilities" property is not affected by the anomaly detector:

Remove the anomaly detector from the classifier:

Create a classifier without an anomaly detector:

Train an anomaly detector from the training inputs:

Add the anomaly detector to the classifier:

Change the value of the acceptance threshold when evaluating the classifier:

Create a predictor and specify that an anomaly detector should be included:

Evaluate the predictor on an non-anomalous input:

Evaluate the predictor on an anomalous input:

The "Distribution" property is not affected by the anomaly detector:

Change the value of the acceptance threshold when evaluating the predictor:

Remove the anomaly detector from the predictor:

Introduced in 2020
 (12.1)