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

k-means算法

于 2022-01-26 发布 文件大小:64.35 kB
0 95
下载积分: 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 个回复

  • ResourceAllocationV2X-master
    说明:  resource allocation in d2d communication
    2019-02-19 21:31:16下载
    积分:1
  • 多GPU快速傅里叶变换
    Sample: Simple CUFFT_MGPU Minimum spec: SM 2.0 Example of using CUFFT. In this example, CUFFT is used to compute the 1D-convolution of some signal with some filter by transforming both into frequency domain, multiplying them together, and transforming the signal back to time domain on Multiple GPU. Key concepts: Image Processing CUFFT Library
    2022-02-05 04:59:51下载
    积分:1
  • HDraw
    使用VC++实现画板功能,使用MFC编程实现。内含有程序源代码。(Use VC++ achieve Sketchpad features, use MFC programming. Contained within the source code.)
    2013-12-06 18:12:55下载
    积分:1
  • FileExplorer QT based
    基于qt的简单文件命令。使用QFileSystemModel,而不是QdirModel。希望这能帮助别人。非常感谢。
    2022-05-21 16:22:44下载
    积分:1
  • C++ 点对点视频聊天程序源码
    说明:  一款视频聊天程序,完整源码,可编译运行,采用c++开发(A video chat program, complete source code, compile and run, using c++ development)
    2021-01-27 20:08:40下载
    积分:1
  • BDXJ
    变电站巡检系统,内容完全 变电站巡检系统,内容完全(Substation inspection system, the contents of substation inspection system, the contents of)
    2007-09-06 16:26:55下载
    积分:1
  • in-ba-asp
    this is online banking project on asp.net
    2013-08-09 16:31:01下载
    积分:1
  • 3ec4ec637dff-(1)
    基于c++ 的水果销售管理系统,使用access数据库,简单实用,方便。适合新手。(C++ based fruit marketing management system, the use of access, simple, practical and convenient. Suitable for beginners.)
    2016-09-01 18:47:42下载
    积分:1
  • MikroKopter_V0.60
    MikroKopter四旋翼飞控板程序,版本6.0(the code of MikroKopter Quadrotors)
    2010-01-14 22:58:10下载
    积分:1
  • BankSystem
    这是一个基于MFC的银行定期储蓄管理系统,界面整洁清晰,功能实用,希望能帮到大家!(This is an MFC-based management system of regular savings banks, the interface is clean and clear, functional and practical, hope to help you!)
    2020-09-25 14:57:48下载
    积分:1
  • 696518资源总数
  • 105922会员总数
  • 10今日下载