# Harbinger Package # version 1.0.777 source("https://raw.githubusercontent.com/cefet-rj-dal/harbinger/master/jupyter.R") #loading Harbinger load_library("daltoolbox") load_library("harbinger") #loading the example database data(examples_anomalies) #Using the simple time series dataset <- examples_anomalies$simple head(dataset) #ploting the time series plot_ts(x = 1:length(dataset$serie), y = dataset$serie) # establishing han_autoencoder method model <- han_autoencoder(3,2) # fitting the model model <- fit(model, dataset$serie) # making detections detection <- detect(model, dataset$serie) # filtering detected events print(detection |> dplyr::filter(event==TRUE)) # evaluating the detections evaluation <- evaluate(model, detection$event, dataset$event) print(evaluation$confMatrix) # ploting the results grf <- har_plot(model, dataset$serie, detection, dataset$event) plot(grf)