用Mathematica对数据进行聚类分析

2025-11-02 12:48:53

1、给出一组数据:

a = RandomReal[{-10, 10}, 20];

聚类:

FindClusters[a]

Mathematica把这组数据分为两类。

用Mathematica对数据进行聚类分析

2、如果希望分为不多于4类,需要指定分组:

FindClusters[a, 4]

用Mathematica对数据进行聚类分析

3、随机给出一组平面上的点集:

a = RandomReal[{-10, 10}, {10000, 2}];

分成三类,并画图:

b = FindClusters[a, 3];

ListPlot[%, AspectRatio -> Automatic]

用Mathematica对数据进行聚类分析

4、分成8类。

用Mathematica对数据进行聚类分析

5、三维空间的点分成三类,并用凸包分隔。

用Mathematica对数据进行聚类分析

用Mathematica对数据进行聚类分析

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢