Train Anomaly Detection Model

Trains an anomaly detection model on a training set

Category: Machine Learning / Train


Applies to: Machine Learning Studio (classic)

This content pertains only to Studio (classic). Similar drag and drop modules have been added to Azure Machine Learning designer. Learn more in this article comparing the two versions.

Module overview

This article describes how to use the Train Anomaly Detection Model module in Azure Machine Learning to create a trained anomaly detection model.

The module takes as input a set of model parameters for anomaly detection model, such as that produced by the One-Class Support Vector Machine module, and an unlabeled dataset. It returns a trained anomaly detection model, together with a set of labels for the training data.

For more information about the anomaly detection algorithms provided in Azure Machine Learning, see these topics:

How to configure Train Anomaly Detection Model

  1. Add the Train Anomaly Detection Model module to your experiment in Studio (classic). You can find the module under Machine Learning, in the Train category.

  2. Connect one of the modules designed for anomaly detection, such as PCA-Based Anomaly Detection or One-Class Support Vector Machine.

    Other types of models are not supported; on running the experiment you will get the error: All models must have the same learner type.

  3. Configure the anomaly detection module by choosing the label column and setting other parameters specific to the algorithm.

  4. Attach a training dataset to the right-hand input of Train Anomaly Detection Model.

  5. Run the experiment.


After training is complete:

  • To view the model's parameters, right-click the module and select Visualize.

  • To create predictions, use Score Model with new input data.

  • To save a snapshot of the trained model, right-click the Trained Model output, and select Save As.


For an example of how anomaly detection is implemented in Azure Machine Learning, see the Azure AI Gallery:

Expected inputs

Name Type Description
Untrained model ILearner interface Untrained anomaly detection model
Dataset Data Table Input data source


Name Type Description
Trained model ILearner interface Trained anomaly detection model


Exception Description
Error 0003 Exception occurs if one or more of inputs are null or empty.

For a list of errors specific to Studio (classic) modules, see Machine Learning Error codes.

For a list of API exceptions, see Machine Learning REST API Error Codes.

See also

Anomaly Detection