library(daltoolbox)
# Load anomaly example data
data(examples_anomalies)
dataset <- examples_anomalies$simple
head(dataset)
# Configure a change-point detector (GARCH)
model <- hcp_garch()
# Fit the detector
model <- fit(model, dataset$serie)
# Run detection
detection <- detect(model, dataset$serie)
# Show detected events
print(detection[(detection$event),])
# Evaluate detections
evaluation <- evaluate(har_eval(), detection$event, dataset$event)
print(evaluation$confMatrix)
# Plot the results
grf <- har_plot(model, dataset$serie, detection, dataset$event)
plot(grf)
Run the code above in your browser using DataLab