Tinjauan clustering hierarkis

Unsupervised Learning di R

Hank Roark

Senior Data Scientist at Boeing

Tinjauan clustering hierarkis

# Fitting various hierarchical clustering models
hclust.complete <- hclust(d, method = "complete")
hclust.average <- hclust(d, method = "average")
hclust.single <- hclust(d, method = "single")
Unsupervised Learning di R

Metode pengaitan: complete & average

metode taut: complete dan average

Unsupervised Learning di R

Clustering hierarkis

Unsupervised Learning di R

Iterasi

iterasi untuk lebih banyak klaster

Unsupervised Learning di R

Dendrogram

5 klaster dan dendrogram selesai

Unsupervised Learning di R

Perbedaan k-means vs clustering hierarkis

k-means vs dendrogram

Unsupervised Learning di R

Hal-hal praktis

# Scale the data
pokemon.scaled <- scale(pokemon)

# Create hierarchical and k-means clustering models
hclust.pokemon <- hclust(dist(pokemon.scaled), method = "complete")
km.pokemon <- kmeans(pokemon.scaled, centers = 3,
                     nstart = 20, iter.max = 50)

# Compare results of the models
cut.pokemon <- cutree(hclust.pokemon, k = 3)
table(km.pokemon$cluster, cut.pokemon)
cut.pokemon
    1   2   3
1 242   1   0
2 342   1   0
3 204   9   1
Unsupervised Learning di R

Ayo berlatih!

Unsupervised Learning di R

Preparing Video For Download...