Machine Learning Algorithms
TDgpt includes a deep learning model for anomaly detection that is built with an autoencoder. This model has been pretrained on the art_daily_small_noise dataset from NAB. For more information about training models, see Preparing Models.
The sample model and its adapter are not loaded by default. To use them:
- Download the files from sample-ad-autoencoder to
/var/lib/taos/taosanode/model/sample-ad-autoencoder/. - Copy the sample adapter misc/autoencoder.py to
taosanalytics/algo/ad/. - Restart taosanode and run
UPDATE ALL ANODES.
For details, see Add Machine Learning Models to TDgpt.
The model directory structure is as follows:
.
└── model
└── sample-ad-autoencoder
├── sample-ad-autoencoder.keras
└── sample-ad-autoencoder.info
--- In the anomaly window, set the algorithm to `sample_ad_model` and the model to `sample-ad-autoencoder`.
SELECT _wstart, count(*)
FROM foo anomaly_window(val, 'algo=sample_ad_model,model=sample-ad-autoencoder');
Note that this model works well only when it is pretrained. Using it with datasets on which it has not been trained will likely produce poor results.
The following algorithms are in development:
- Isolation Forest
- One-Class Support Vector Machines (SVM)