登录
首页 » c » k-means算法

k-means算法

于 2022-01-26 发布 文件大小:64.35 kB
0 144
下载积分: 2 下载次数: 1

代码说明:

#include #include #define N 11 //代表数据点的个数 #define K 3 //代表簇的个数 typedef struct { float x; float y; }Point; //代表数据点的数据结构 int center[N];  //判断每个点属于哪个簇 Point point[N] = { {2.0, 10.0},{2.0, 5.0},{8.0, 4.0},{5.0, 8.0},{7.0, 5.0}, {6.0, 4.0},{1.0, 2.0},{4.0, 9.0},{7.0, 3.0},{1.0, 3.0}, {3.0, 9.0}}; Point mean[K];  //保存每个簇的中心点 float getDistance(Point point1, Point point2); void getMean(int center[N]); float getE(); void cluster(); int main() {     int i, j; int n = 0; //统计进行了多少次聚类     float temp1; //用于存平方误差     float temp2;     printf(" 处理的数据点集合为: ");     for(i = 0; i < N; ++i)     {  

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • imreconstruct
    此函数是用C语言编写的MEX文件,与MATLAB中imreconstruct函数功能相同,效果一样,运行速率更快。(This function is written in C MEX file, the same function with in MATLAB imreconstruct function, the same effect faster run rate.)
    2012-08-01 16:49:21下载
    积分:1
  • Textscroll
    说明:  用VS2010做的MFC界面的状态栏或者字幕的滚动(Use VS2010's MFC interface status bar or subtitle scrolling)
    2017-08-09 11:35:18下载
    积分:1
  • STM32驱动指纹模块
    STM32驱动指纹模块  实现加载指纹,读取指纹,比对指纹,STM32驱动指纹模块  实现加载指纹,读取指纹,比对指纹
    2023-01-03 04:40:08下载
    积分:1
  • KZK
    求解KZK方程的VISUAL C++源代码 具有计算速度快,计算精度高等优点。(source code solution of KZK equation visual c++)
    2021-05-13 10:30:02下载
    积分:1
  • 串口服务器socket部分代码
    串口服务器源代码,这是socket部分,W5500芯片,由沈阳某人初版本由沈阳某人编写,主控芯片为stm32f103C8T6,经测试,好用。
    2022-05-14 18:46:41下载
    积分:1
  • Psychoacoustic-model
    心理声学模型及其在MP3编码中的应用,详细介绍其中的流程图,及核心公式。(Psychoacoustic model and its application in the MP3 encoding, the flow chart and the core formula.)
    2016-06-23 16:15:25下载
    积分:1
  • test
    STM32 中文资料,详细记录着程序的的使用,包括源文件的程序框架。(STM32 Chinese data, a detailed record of program use, including program source file.)
    2014-08-31 23:10:30下载
    积分:1
  • dx9_spot_light
    说明:  DirectX9.0 编程基础 点光源(DirectX 9.0 basis points Source Programming)
    2006-01-14 23:26:11下载
    积分:1
  • c8051uart
    这是一个基于C51的软件模拟串口程序,希望对大家有用。(This is a C51-based simulation software serial procedures in the hope that useful.)
    2011-08-03 17:25:11下载
    积分:1
  • stm32l152 demo 程序
    stm32l152 demo 程序 This directory contains a set of sources files and pre-configured projects that describes the demonstration firmware running on the STM32L152D-EVAL evaluation board, which can be used to evaluate the capabilities of the STM32L ultra low power medium density STM32L152ZD microcontroller and on-board peripherals.
    2023-06-14 07:30:30下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载