【问题标题】:Validating Fuzzy Clustering验证模糊聚类
【发布时间】:2018-11-13 17:16:02
【问题描述】:

我想在一个包含 41 个变量和 415 个观察值的大型无监督数据集上使用模糊 C 均值聚类。但是,我一直在尝试验证这些集群。当我使用随机数量的集群进行绘图时,我可以解释总共 54% 的方差,这不是很好,并且没有像 iris 数据库那样真正好的集群。

首先我在 3 个集群上运行 fcm 与我的规模数据只是为了查看,但如果我试图找到搜索最佳集群数量的方法,那么我不想设置任意定义的数量集群。

所以我转向谷歌并在谷歌上搜索:“验证 R 中的模糊聚类。” This link here was good,但我仍然需要尝试一堆不同数量的集群。我查看了advclustppclustclvalid 包,但找不到这些功能的演练。我查看了每个包的文档,但也无法辨别下一步该做什么。

我浏览了一些可能数量的集群,并使用来自 fanny 的 k.crisp 对象检查了每个集群。我从 100 开始下降到 4。根据文档中的对象描述,

k.crisp=integer ( ≤ k ) 给出清晰簇的数量;可以小于 k , 建议减少 memb.exp.

这似乎不是一种有效的方法,因为它是将清晰集群的数量与我们的模糊集群进行比较。

是否有可以从2:10 集群检查集群有效性的功能?另外,检查 1 个集群的有效性是否值得?我认为这是一个愚蠢的问题,但我有一种奇怪的感觉 1 最佳集群可能是我得到的。 (如果我要获得 1 个集群,除了在里面哭一点之外,还有什么建议吗?)

代码

library(cluster)
library(factoextra)
library(ppclust)
library(advclust)
library(clValid)
data(iris)
df<-sapply(iris[-5],scale)
res.fanny<-fanny(df,3,metric='SqEuclidean')
res.fanny$k.crisp
# When I try to use euclidean, I get the warning all memberships are very close to 1/l. Maybe increase memb.exp, which I don't fully understand
# From my understanding using the SqEuclidean is equivalent to Fuzzy C-means, use the website below. Ultimately I do want to use C-means, hence I use the SqEuclidean distance
fviz_cluster(Res.fanny,ellipse.type='norm',palette='jco',ggtheme=theme_minimal(),legend='right')
fviz_silhouette(res.fanny,palette='jco',ggtheme=theme_minimal())

# With ppclust
set.seed(123)
res.fcm<-fcm(df,centers=3,nstart=10)

website as mentioned above.

【问题讨论】:

    标签: r validation cluster-analysis


    【解决方案1】:

    据我所知,您需要查看不同数量的集群,看看解释的方差百分比如何随着集群数量的不同而变化。这种方法称为肘法。

    wss <- sapply(2:10, 
           function(k){fcm(df,centers=k,nstart=10)$sumsqrs$tot.within.ss})
    
    plot(2:10, wss,
         type="b", pch = 19, frame = FALSE, 
         xlab="Number of clusters K",
         ylab="Total within-clusters sum of squares")
    

    结果图是

    在 k = 5 之后,簇内的总平方和趋于缓慢变化。因此,根据肘法,k = 5 是最佳聚类数的一个很好的候选。

    【讨论】:

    • 我正在寻找更多的正式方法。但这不是使用 K-means 聚类吗?
    • 目的类似,所以我认为我们可以使用这种方法。请查看这篇论文,researchgate.net/publication/… 他们使用 k = 1 作为零假设并使用某种度量并在图表上寻找“肘部”。
    猜你喜欢
    • 2014-07-02
    • 1970-01-01
    • 2016-02-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-08
    • 2012-07-17
    相关资源
    最近更新 更多