hanc_ml | R Documentation |
Anomaly detection using daltoolbox classification. A training and test set should be used. The training set must contain labeled events. A set of preconfigured of classification methods are described in https://cefet-rj-dal.github.io/daltoolbox/. They include: cla_majority, cla_dtree, cla_knn, cla_mlp, cla_nb, cla_rf, cla_svm
hanc_ml(model)
model |
DALToolbox classification model |
hanc_ml
object
library(daltoolbox)
#loading the example database
data(examples_anomalies)
#Using example tt
dataset <- examples_anomalies$tt
dataset$event <- factor(dataset$event, labels=c("FALSE", "TRUE"))
slevels <- levels(dataset$event)
# separating into training and test
train <- dataset[1:80,]
test <- dataset[-(1:80),]
# normalizing the data
norm <- minmax()
norm <- fit(norm, train)
train_n <- transform(norm, train)
# establishing decision tree method
model <- hanc_ml(cla_dtree("event", slevels))
# fitting the model
model <- fit(model, train_n)
# evaluating the detections during testing
test_n <- transform(norm, test)
detection <- detect(model, test_n)
print(detection[(detection$event),])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.