train
Description
Add-On Required: This feature requires the Time Series Anomaly Detection for MATLAB add-on.
The train function trains deep learning anomaly detectors as
part of the time series anomaly detection workflow.
The deep learning anomaly detectors use either training options from the option set in
trainingOptions (Deep Learning Toolbox) that Deep Learning Toolbox™ provides or standalone name-value options in train that
reproduce the essential functionality of the corresponding
trainingOptions options. These options include items like
Solver, MaxEpochs and Verbose, as
well as GPU and parallel CPU processing.
trains the anomaly detector detector = train(detector,trainData)detector with a training data set
trainData that contains only normal data, and not any anomalous data.
This syntax uses default options.
When the ThresholdMethod property for detector
is set to any method but "manual", train also
obtains the detection threshold that the detector uses to identify an anomaly.
You can use train to train a newly created detector or continue the
training of a previously trained detector.
For an example of using train as part of the detector development
workflow, see Train and Test TCN Anomaly Detector.
For training deep learning detectors, this function requires Deep Learning Toolbox.
specifies the training options explicitly, rather than through
detector = train(detector,trainData,Name=Value)trainingOptions. The options you can set depend on the detector model
you are training.
TcnDetectorandDeepantDetectoraccept only atrainingOptions(Deep Learning Toolbox) option set that you configure separately.UsadDetectoraccepts certain training options as individual name-value arguments.VaelstmDetectoraccepts both aTrainingOptionsset and individual name-value arguments.
Input Arguments
Name-Value Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2025aSee Also
detect | plot | plotHistogram | updateDetector | tcnAD | deepantAD | usAD | vaelstmAD