用C#实现k均值聚类算法 C# C# PAUL-MAPLE(Using C# to achieve K means clustering algorithm C#, C#, PAUL-MAPLE).doc
- 1、本文档共14页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
用C#实现k均值聚类算法 C# C# PAUL-MAPLE(Using C# to achieve K means clustering algorithm C#, C#, PAUL-MAPLE)
用C#实现k均值聚类算法 C# C# PAUL-MAPLE(Using C# to achieve K means clustering algorithm C#, C#, PAUL-MAPLE)
K mean algorithm is a pattern recognition problem of poly classification, which is implemented using C# algorithm
Here is the program source code:
Using System;
Using System.Drawing;
Using System.Collections;
Using System.ComponentModel;
Using System.Windows.Forms;
Using System.Data;
Namespace KMean_win
{
X
The Form1 / / / note.
X
Public class Form1: System.Windows.Forms.Form
{
X
The designer must always variable.
X
Private, System.ComponentModel.Container, components = null;
Private static int k = 2; / / class number, this example into 2 categories
Private static int total = 20; / / point number
Private int test = 0;
Private PointF[] unknown = new PointF[total]; / / set points
Private int[] type = new int[total]; / / each temporary class
Public PointF[] z = new PointF[k]; / / save the new clustering center
Public PointF[] Z0 = new PointF[k]; / / keep on a cluster center
Private PointF sum;
Private int temp = 0;
Private System.Windows.Forms.TextBox textBox1;
Private Int l = 0; / / the number of iterations
/ / constructor initialization
Public, Form1 ()
{
Unknown[0]=new Point (0,0);
Unknown[1]=new Point (1,0);
Unknown[2]=new Point (0,1);
Unknown[3]=new Point (1,1);
Unknown[4]=new Point (2,1);
Unknown[5]=new Point (1,2);
Unknown[6]=new Point (2,2);
Unknown[7]=new Point (3,2);
Unknown[8]=new Point (6,6);
Unknown[9]=new Point (7,6);
Unknown[10]=new Point (8,6);
Unknown[11]=new Point (6,7);
Unknown[12]=new Point (7,7);
Unknown[13]=new Point (8,7);
Unknown[14]=new Point (9,7);
Unknown[15]=new Point (7,8);
Unknown[16]=new Point (8,8);
Unknown[17]=new Point (9,8);
Unknown[18]=new Point (8,9);
Unknown[19]=new Point (9,9);
InitializeComponent ();
Test = 0;
Choice K initial clustering center z[i]
For (int, i=0, I, z[i] = unknown[i]);
For (int, i=0, I, type[i] = 0);
}
A new clustering center / / calculation
Public PointF newCenter (int m)
{
Int N = 0;
For (int i=0; I {
if ([i] = m
您可能关注的文档
- 学习室内设计必看的AutoCAD教程【精校版】(Learning interior design must see the AutoCAD tutorial [refined school version]).doc
- 学习动机、学习迁移与学习策略(Learning motivation, learning transfer and learning strategies).doc
- 学习小组文化墙设计(Learning group cultural wall design).doc
- 学习十七届三中全会精神入党思想汇报(Learn the spirit of the third Plenary Session of the 17th CPC Central Committee and report to the party).doc
- 学习散文(Study prose).doc
- 学习编程(Learning programming).doc
- 学习网球的心得体会(The experience of learning tennis).doc
- 学习autocad的心得(Learn AutoCAD's experience).doc
- 学习英语兴趣1(Interest in learning English 1).doc
- 学习跑酷需要锻炼的一些内容(Learning Parkour requires some exercise).doc
文档评论(0)