TimeSeriesIForestDetector
Detect subsequence anomalies in time series using an isolation forest algorithm
Since R2026a
Description
Add-On Required: This feature requires the Time Series Anomaly Detection for MATLAB add-on.
The TimeSeriesIForestDetector object implements an isolation
forest algorithm within a detector model capable of being trained to detect subsequence
anomalies in time series data using only nominal data.
TimeSeriesIForestDetector provides a time series version, for outlier
point and subsequence detection, of the IsolationForest
detector in Statistics and Machine Learning Toolbox™.
Creating a TimeSeriesIForestDetector model is the first step in a
workflow that includes training the detector with normal data, testing the detector with
anomalous data, and validating the model by visualizing detection effectiveness on anomalous
data using plotting functions. To improve detection performance, you can use updateDetector
to change certain properties, such as threshold properties, by updating the trained model
without retraining. To change other properties, you must create a new detector object and
specify the new properties using name-value arguments. You cannot modify detector properties
using dot notation.
For more information on the Isolation Forest algorithm on which
TimeSeriesIForestDetector is based, see Anomaly Detection with Isolation Forest.
For more information on the functions this workflow uses, see Object Functions.
Creation
Create a TimeSeriesIForestDetector object by using the timeSeriesIforestAD function.
Properties
Object Functions
train | Train time series machine learning anomaly detector and obtain detection threshold |
detect | Detect anomalies in time series using a trained time series machine learning detector model |
plot | Plot detected anomalies and anomaly scores generated from trained machine learning anomaly detectors |
plotHistogram | Plot histogram of anomaly scores and detection threshold for trained machine learning anomaly detector |
updateDetector | Update settings of a trained time series machine learning anomaly detector and recompute detection threshold |
References
[1] Liu, F. T., K. M. Ting, and Z. Zhou. "Isolation Forest," 2008 Eighth IEEE International Conference on Data Mining. Pisa, Italy, 2008, pp. 413-422.
Version History
Introduced in R2026a