Professional Documents
Culture Documents
Prac 6
Prac 6
Compare the performance of clusters by changing the parameters involved in the algorithms.
pro6.R
library(dbscan)
#kmeans
cl <- kmeans(iris[,-5], 3)
Xplot(iris[,-5], col = cl$cluster)
points(cl$centers, col = 1:3, pch = 8)
#heirarchical
clusters <- hclust(dist(iris[, -5]))
plot(clusters)
#DBScan
cl <- dbscan(iris[,-5], eps = .5, minPts = 5)
plot(iris[,-5], col = cl$cluster)
OUTPUT: