简体   繁体   English

R - DBSCAN fviz_cluster - 使用dim1 和dim2 获取元素的坐标

[英]R - DBSCAN fviz_cluster - get coordinates of elements with dim1 and dim2

I'm a noob with R, and I'm trying to do clustering on some data samples.我是 R 的菜鸟,我正在尝试对一些数据样本进行聚类。 I've tried a PCA,我试过 PCA,

res.pca <- PCA(df, 
               ncp = 5, # nb composantes principales.
               graph = TRUE,
               )

and I can get the full elements list with new coordinates using我可以使用新坐标获取完整的元素列表

res.pca$ind

This is great and works perfectly for info using the 2 first axis with the PCA, I've 80% of variability on one axis and a bit more than 10% on the Second axis.这很棒,非常适合使用带有 PCA 的第 2 个轴的信息,我在一个轴上有 80% 的可变性,在第二个轴上有 10% 以上的可变性。 I was quite proud of the result considering that I've 30 variables ... and in the End the PCA implicitly says that 2 dimension will be enough.考虑到我有 30 个变量,我对结果感到非常自豪……最后,PCA 暗示说 2 维就足够了。

Still working on those data I tried the DBSCAN Clustering method fpc::dbscan :仍在处理这些数据我尝试了 DBSCAN 聚类方法fpc::dbscan

library (factoextra)
db <- fpc::dbscan(df, eps = 22, MinPts = 3)

and after doing the dbscan and graphing the clusters using fviz_cluster, the Two dimensions display says : 92.8% on axis 1 and 6.7% on axis 2!!!!在执行 dbscan 并使用 fviz_cluster 绘制集群图形后,二维显示显示:轴 1 上的 92.8% 和轴 2 上的 6.7% !!!! (more than 99% of the total variance explained with 2 axis ! (超过 99% 的总方差用 2 轴解释!

In short, the DBSCAN has transformed my 30 variables data in a way that looks to be better than the PCA.简而言之,DBSCAN 以一种看起来比 PCA 更好的方式转换了我的 30 个变量数据。 The overall clustering of DBSCAN is rubbish for my data, but the transformation that has been used is absolutely excellent. DBSCAN的整体聚类对我的数据来说是垃圾,但是用过的transformation绝对是优秀的。

My issue is that I would like to get access to those new coordinates ... but no way at this time... the only accessible variables I can see are : db$cluster, db$eps, db$Minpts, db$isseed我的问题是我想访问这些新坐标......但目前没有办法......我能看到的唯一可访问变量是: db$cluster, db$eps, db$Minpts, db$isseed

BUT I suspect that some data are accessible otherwize how fviz_cluster, could present the data.但我怀疑某些数据是可以访问的,否则 fviz_cluster 可以如何呈现数据。

Any Idea ?任何的想法 ?

The projection is not done by dbscan.投影不是由 dbscan 完成的。 fviz_cluster uses the first two components obtained via stats::prcomp on the data. fviz_cluster使用通过stats::prcomp在数据上获得的前两个组件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM