HCPC r函数——聚类数据和聚类可视化的区别
HCPC r function - difference between cluster data and cluster visualisation
我正在使用包 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 在红色的集群中! (绿色簇的其他状态留在从地图到dendrogram/tree的绿色簇中):
plot(hcpc, choice = 'map')
plot(hcpc, choice = 'tree')
根据数值结果(hcpc$data.clust
),cluster3(绿色集群)中有 8 个观测值,与 'map' 可视化匹配(但与 dendrogram/tree 可视化不匹配) .
你知道我是否做错了什么,是否错过了重要的事情?
在 HCPC 函数中,第一个参数是 Consol=T:
Consol a boolean. If TRUE, a k-means consolidation is performed
(consolidation cannot be performed if kk is used and equals a number).
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')
希望对您有所帮助
我正在使用包 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 在红色的集群中! (绿色簇的其他状态留在从地图到dendrogram/tree的绿色簇中):
plot(hcpc, choice = 'map')
plot(hcpc, choice = 'tree')
根据数值结果(hcpc$data.clust
),cluster3(绿色集群)中有 8 个观测值,与 'map' 可视化匹配(但与 dendrogram/tree 可视化不匹配) .
你知道我是否做错了什么,是否错过了重要的事情?
在 HCPC 函数中,第一个参数是 Consol=T:
Consol a boolean. If TRUE, a k-means consolidation is performed (consolidation cannot be performed if kk is used and equals a number).
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')
希望对您有所帮助