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),])
Run the code above in your browser using DataLab