gpt4 book ai didi

algorithm - Matlab 聚类 : not working properly over large set of data

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:54:45 25 4
gpt4 key购买 nike

Cluster analysis

我有一组数据,可以分为两组。沿 y 轴的垂直设置和沿 x 轴的水平设置。我试图分别用蓝色和红色绘制它们。但是正如您所看到的,一些蓝色与红色混合在一起。有人可以帮助我使用聚类正确地做到这一点吗?我使用 kmeans 来做到这一点。

[cidx2,cmeans2] = kmeans(minSpikeV,2);

但是好像效果不是很好。

我按照@mpaskov 提到的那样做了。但现在我明白了。那些红色矩形应该是蓝色方 block 。谁能帮帮我吗 ? enter image description here

最佳答案

您可以使用不同的方式初始化方法或自己指定它们。

% uses random samples
[cidx2,cmeans2] = kmeans(minSpikeV,2, 'Start', 'sample');

% not 100% on the dimensions, but I can not try as I do not have the toolbox for kmeans
[cidx2,cmeans2] = kmeans(minSpikeV,2, 'Start', [-0.05,2; -0.25,0.1]);

阅读 documentation 中的详细信息

关于algorithm - Matlab 聚类 : not working properly over large set of data,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40220020/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com