hanr_ml: Anomaly detector based on machine learning regression.

View source: R/hanr_ml.R

hanr_mlR Documentation

Anomaly detector based on machine learning regression.

Description

Anomaly detection using daltoolbox regression The regression model adjusts to the time series. Observations distant from the model are labeled as anomalies. A set of preconfigured regression methods are described in https://cefet-rj-dal.github.io/daltoolbox/. They include: ts_elm, ts_conv1d, ts_lstm, ts_mlp, ts_rf, ts_svm

Usage

hanr_ml(model, sw_size = 15)

Arguments

model

DALToolbox regression model

sw_size

sliding window size

Value

hanr_ml object

Examples

library(daltoolbox)

#loading the example database
data(examples_anomalies)

#Using simple example
dataset <- examples_anomalies$simple
head(dataset)

# setting up time series regression model
model <- hanr_ml(ts_elm(ts_norm_gminmax(), input_size=4, nhid=3, actfun="purelin"))

# fitting the model
model <- fit(model, dataset$serie)

detection <- detect(model, dataset$serie)

# filtering detected events
print(detection[(detection$event),])


harbinger documentation built on June 22, 2024, 7:38 p.m.