| hanr_ml | R Documentation |
Trains a regression model to forecast the next value from a sliding window and flags large prediction errors as anomalies. Uses DALToolbox regressors.
A set of preconfigured regression methods are described at
https://cefet-rj-dal.github.io/daltoolbox/ (e.g., ts_elm, ts_conv1d,
ts_lstm, ts_mlp, ts_rf, ts_svm).
hanr_ml(model, sw_size = 15)
model |
A DALToolbox regression model. |
sw_size |
Integer. Sliding window size. |
hanr_ml object.
Hyndman RJ, Athanasopoulos G (2021). Forecasting: Principles and Practice. OTexts.
Goodfellow I, Bengio Y, Courville A (2016). Deep Learning. MIT Press.
library(daltoolbox)
library(tspredit)
# Load anomaly example data
data(examples_anomalies)
# Use a simple example
dataset <- examples_anomalies$simple
head(dataset)
# Configure a time series regression model
model <- hanr_ml(tspredit::ts_elm(tspredit::ts_norm_gminmax(),
input_size=4, nhid=3, actfun="purelin"))
# Fit the model
model <- daltoolbox::fit(model, dataset$serie)
# Run detection
detection <- detect(model, dataset$serie)
# Show detected anomalies
print(detection[(detection$event),])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.