【问题标题】:HCPC r function - difference between cluster data and cluster visualisationHCPC r函数——集群数据和集群可视化的区别
【发布时间】:2017-04-26 19:41:05
【问题描述】:

我正在使用包 FactoMiner 及其功能 HCPC 来创建一些观察的分段。然后我使用了函数plot.HCPC(),我观察到了这个函数的两个备选方案之间的差异(两个备选方案说明了相同的结果......)

library(FactoMineR) data(USArrests) pca <- PCA(USArrests, ncp = 3, graph = FALSE) hcpc <- HCPC(pca, graph = FALSE)

如果我使用choice = 'map',我们看到Arkansas 在绿色集群中,但如果我使用choice = 'tree'Arkansas 在红色集群中! (绿色集群的其他状态从地图到树状图/树都停留在绿色集群中):

plot(hcpc, choice = 'map') plot(hcpc, choice = 'tree')

根据数值结果 (hcpc$data.clust),集群 3(绿色集群)中有 8 个观测值,与“地图”可视化(但不符合树状图/树可视化)相匹配。 你知道我是否做错了什么,如果我错过了一些重要的事情吗?

【问题讨论】:

    标签: r hierarchical-clustering dendrogram


    【解决方案1】:

    在 HCPC 函数中,第一个参数是 Consol=T:

    Consol 一个布尔值。如果为 TRUE,则执行 k 均值合并 (如果使用kk且等于数字,则无法进行合并)。

    library(FactoMineR) 
     data(USArrests)
     pca <- PCA(USArrests, ncp = 3, graph = FALSE)
     hcpc <- HCPC(res.pca,consol=F, graph = FALSE)
     plot(hcpc, choice = 'map')
     plot(hcpc, choice = 'tree')
    

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 2015-08-07
      • 2020-03-30
      • 2014-04-18
      • 1970-01-01
      • 2018-09-07
      • 2018-09-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多