# DAL ToolBox
# version 1.01.727
source("https://raw.githubusercontent.com/cefet-rj-dal/daltoolbox/main/jupyter.R")
#loading DAL
load_library("daltoolbox")
Loading required package: daltoolbox Registered S3 method overwritten by 'quantmod': method from as.zoo.data.frame zoo Attaching package: ‘daltoolbox’ The following object is masked from ‘package:base’: transform
#load dataset
data(iris)
General entropy of dataset
# setup clustering
model <- cluster_dbscan(minPts = 3)
# build model
model <- fit(model, iris[,1:4])
clu <- cluster(model, iris[,1:4])
table(clu)
clu 0 1 2 3 4 26 47 38 4 35
# evaluate model using external metric
eval <- evaluate(model, clu, iris$Species)
eval
x | ce | qtd | ceg |
---|---|---|---|
<fct> | <dbl> | <int> | <dbl> |
0 | 1.1841636 | 26 | 0.20525503 |
1 | 0.0000000 | 47 | 0.00000000 |
2 | 0.0000000 | 38 | 0.00000000 |
3 | 0.0000000 | 4 | 0.00000000 |
4 | 0.4220005 | 35 | 0.09846679 |