首页 > 解决方案 > 可视化 PAM 集群

问题描述

我正在使用 PAM 算法进行聚类,并希望将结果可视化。enter code here

# Computing PAM Clustering

pam.res <- pam(WKA_ohneJB_sam, 4)

print(pam.res)

# Adding Point Classification

point_class <- cbind(WKA_ohneJB_sam, cluster = pam.res$cluster) 
head(point_class, n=20)

# Cluster Mediods

pam.res$medoids

# Visualizing PAM Clusters

fviz_cluster (pam.res, 
              palette = c("#00AFBB", "#FC4E07", "#2E9FDF", "#006600"), # color palette
              ellipse.type = "t",  #Concentration ellipse 
              repel = TRUE, # Avoid label overplotting (slow) 
              ggtheme = theme_classic() 
              )
>  
> Error : The dimension of the data < 2! No plot. 

我的语法到底需要改变什么?

在此处输入图像描述

标签: rcluster-analysis

解决方案


推荐阅读