当前位置:网站首页>[data analysis] data clustering and grouping based on kmeans, including Matlab source code
[data analysis] data clustering and grouping based on kmeans, including Matlab source code
2022-06-12 21:58:00 【Matlab scientific research studio】
1 brief introduction
From theory , Design program and code implementation , Explain how data mining K- Mean clustering algorithm , utilize Matlab The flexible programming function of . Illustrated by experimental teaching practice , In order to cultivate innovative thinking and practical ability throughout experimental teaching , utilize Matlab Simulation K- Mean clustering has better practical significance .
Clustering is the process of recombining data sets into multiple classes according to the similarity of data . Clustering is different from classification : Classification is a supervised learning method , The characteristics of data classes are known before classification ; Clustering is an unsupervised learning method , Do not know the characteristics of data classes before clustering . In the experimental teaching of data mining , Teachers often only pay attention to the clustering algorithm itself , Not really understand the essence of clustering , Only the clustering algorithm is written in a fixed form , Even only the program that cannot be changed and the pre-set divided array are clustered , Misunderstood the essence of clustering , The flexible algorithm and clustering idea are not integrated into the experiment . The purpose of cultivating students' innovative thinking and ability in the experiment has not been achieved .


2 Part of the code
function []=show(X,cidx,ctrs,varargin)%{show[X,cidx,ctrs] X A matrix of input raw data ,cidx,ctrs by k_meansnD The result returned ,They are n Grouping and centroid coordinates of iterations .show[X,cidx,ctrs,stp] The number of iterations displayed is stp The grouping at the time .%}if nargin<3error('there is not enough input arguments >.<#~ ')elseif nargin==3idx=cidx(:,end); % If the input variable is 3 individual ,idx Fu Cheng cidx The last column of , That is, the final grouping .ctr=ctrs(:,:,end); %ctr Be endowed with ctrs The last page of , That is, the final center of mass coordinates .elseif nargin==4stp=varargin{1};idx=cidx(:,stp);ctr=ctrs(:,:,stp);elseif nargin>4error('there is too many input arguments >.<#~ ')end %end ifk=size(ctrs,1);C=jet(k);d=size(X,2);if d==2for i=1:kplot(X(idx==i,1),X(idx==i,2),'.','color',C(i,:));hold on;plot(ctr(i,1),ctr(i,2),'kx')hold on;end %end forhold off;elseif d==3for i=1:kplot3(X(idx==i,1),X(idx==i,2),X(idx==i,3),'.','color',C(i,:));hold on;plot3(ctr(i,1),ctr(i,2),ctr(i,3),'kx')hold on;end %end forhold off;end %end ifgrid onend %end function
3 Simulation results

4 reference
About bloggers : Good at intelligent optimization algorithms 、 Neural networks predict 、 signal processing 、 Cellular automata 、 The image processing 、 Path planning 、 UAV and other fields Matlab Simulation , relevant matlab Code problems can be exchanged by private letter .
Some theories cite network literature , If there is infringement, contact the blogger to delete .
边栏推荐
- KDD2022 | GraphMAE:自监督掩码图自编码器
- Is it safe to open an account in tonghuashun? How to open an account
- SQL tuning guide notes 10:optimizer statistics concepts
- [simple] 155 Minimum stack
- What is the difference between a user thread and a daemon thread?
- ICML2022 | GALAXY:极化图主动学习
- Icml2022 | Galaxy: apprentissage actif des cartes de polarisation
- What is embedded
- MySQL architecture and basic management (II)
- Gzip compression decompression
猜你喜欢

Kdd2022 | graphmae: self supervised mask map self encoder

复杂系统如何检测异常?北卡UNCC等最新《复杂分布式系统中基于图的深度学习异常检测方法综述》,阐述最新图异常检测技术进展

Use group_ Dplyr issues when using group_ by(multiple variables)

Ansible playbook和Ansible Roles(三)

Mr. Sun's version of JDBC (21:34:25, June 12, 2022)

Palindrome linked list and linked list intersection problem (intersecting with Xinyi people) do you really know?

Ansible PlayBook et ansible roles (3)

Xingda easy control ModbusRTU to modbustcp gateway

最近公共祖先问题你真的学会了吗?

How to specify your webpage's language so Google Chrome doesn't offer to translate it
随机推荐
经济学人聚焦WTO MC12:数字经济或成重要议题
SQL tuning guide notes 13:gathering optimizer statistics
Oracle 19C installation documentation
User guide for JUC concurrency Toolkit
Ansible playbook和Ansible Roles(三)
Data batch writing
[medium] 78 Subset (backtracking shall be supplemented later)
What is embedded
"Oracle database parallel execution" technical white paper reading notes
Oracle LiveLabs实验:Introduction to Oracle Spatial Studio
Interpretation of OCP function of oceanbase Community Edition
Unity commonly used 3D mathematical calculation
SQL tuning guide notes 12:configuring options for optimizer statistics gathering
[Jianzhi offer] Jianzhi offer 05 Replace spaces
六月集训(第10天) —— 位运算
SQL调优指南笔记10:Optimizer Statistics Concepts
PCB package download website recommendation and detailed usage
Recommended Chinese font in the code input box of Oracle SQL developer
在同花顺开户证券安全吗,证券开户怎么开户流程
Icml2022 | galaxy: active learning of polarization map