【问题标题】:Fuzzy c-mean clustering模糊 c 均值聚类
【发布时间】:2018-05-03 02:20:51
【问题描述】:
[centers,U,obj_fcn] = fcm(sod,5);
expo = 2.0;                             
max_iter = 100;                         
min_impro = 1e-6; 
figure,
scatter3(sod1(:,1),sod1(:,2),sod1(:,3),'ob')
hold on
scatter3(sod2(:,1),sod2(:,2),sod2(:,3),'oc')
scatter3(sod3(:,1),sod3(:,2),sod3(:,3),'og')
scatter3(sod4(:,1),sod4(:,2),sod4(:,3),'or')
scatter3(sod5(:,1),sod5(:,2),sod5(:,3),'om')
scatter3(centers(1,1),centers(1,2),centers(1,3),'xb','Sizedata',100,'LineWidth',3)
scatter3(centers(2,1),centers(2,2),centers(2,3),'xc','Sizedata',100,'LineWidth',3)
scatter3(centers(3,1),centers(3,2),centers(3,3),'xg','Sizedata',100,'LineWidth',3)
scatter3(centers(4,1),centers(4,2),centers(4,3),'xr','Sizedata',100,'LineWidth',3)
scatter3(centers(5,1),centers(5,2),centers(5,3),'xm','Sizedata',100,'LineWidth',3)
legend('P.1','P.2','P.3','P.4','P.5','P.1 center','P.2 center','P.3 center','P.4 center','P.5 center')
hold off
title 'Fuzzy C Mean';
view(3), axis vis3d, box on, rotate3d on
xlim ([0 10])
ylim ([0 10])
zlim ([0 10])
xlabel('Severity')
ylabel('Occurrence')
zlabel('Detect')

每次运行代码后,模糊c-mean聚类的质心都不一样。有什么问题吗?

sod1到sod5是sod的部分数据,我把它们提取成部分

【问题讨论】:

    标签: matlab fuzzy


    【解决方案1】:

    来自fcm 文档:

    fcm 在集群期间执行以下步骤:
    1 随机初始化集群成员值,μij

    因为优化问题是随机初始化的,很可能会卡在局部最小值,每次都会找到不同的结果。

    使用 k-means 和模糊 c-means(它们非常相似)的一种方法是多次运行聚类并查看是否比其他中心更频繁地找到任何一组中心。这可能是局部最小值中最稳定的一个。

    如果您需要确定性方法,请滚动您自己的函数版本并对其进行确定性初始化。内置方法似乎没有这个选项。虽然也许你可以在调用函数之前将随机数生成器设置为固定值?一个简单的

    rng(0);
    [centers,U,obj_fcn] = fcm(sod,5);
    

    可以做到这一点。 See the documentation

    【讨论】:

      猜你喜欢
      • 2018-08-19
      • 1970-01-01
      • 2021-11-05
      • 2016-04-22
      • 1970-01-01
      • 2014-07-02
      • 2021-09-27
      • 2011-11-29
      • 2011-12-07
      相关资源
      最近更新 更多