Phân cụm từ đơn giản

Khai phá văn bản với Bag-of-Words trong R

Ted Kwartler

Instructor

Ví dụ phân cụm phân cấp

dist_rain <- dist(rain[, 2])

Ví dụ phân cụm phân cấp

Khai phá văn bản với Bag-of-Words trong R

Dendrogram đơn giản

# Convert to hierarchical cluster obj
hc <- hclust(dist_rain)

# Plot dendrogram with city labels plot(hc, labels = rain$city)

cay phân cấp (dendrogram)

Khai phá văn bản với Bag-of-Words trong R

Thẩm mỹ cho dendrogram

# Load dendextend package
library(dendextend)

# Convert distance matrix to dendrogram hc <- hclust(tweets_dist) hcd <- as.dendrogram(hc)
# Color branches
hcd <- branches_attr_by_labels(hcd, 
           c("marvin", "gaye"), "red")

# Plot dendrogram with some aesthetics plot(hcd, main = "Better Dendrogram") rect.dendrogram(hcd, k = 2, border = "grey50")

thẩm mỹ cho dendrogram

Khai phá văn bản với Bag-of-Words trong R

Hãy thực hành!

Khai phá văn bản với Bag-of-Words trong R

Preparing Video For Download...