-
k-means算法
#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)
{
- 2022-01-26 19:53:04下载
- 积分:1
-
msssim
图像质量评价代码,用于评估两副图片的相似度(Image quality evaluation)
- 2017-09-29 16:29:23下载
- 积分:1
-
小甲鱼数据结构与算法课件+源码
小甲鱼数据结构与算法课件+源码,适合初学者学习(Small turtle data structure and algorithm courseware + source code, suitable for beginners to learn)
- 2020-11-26 23:49:31下载
- 积分:1
-
osip协议栈代码
Osip2是一个开放源代码的sip协议栈,是开源代码中不多使用C语言写的协议栈之一,它具有短小简洁的特点,专注于sip底层解析使得它的效率比较高。但缺点也很明显,首先就是可用性差,没有很好的api封装,使得上层应用在调用协议栈时很破碎;其次,只做到了transaction层次的协议过程解析,缺少call、session、dialog等过程的解析,这也增加了使用的难度;再次,缺少线程并发处理的机制,使得它的处理能力有限。
- 2022-03-15 01:24:57下载
- 积分:1
-
opencv-relex-detection-
对槽内多边形区域是否松动出槽外的松动检测,本程序运用harris角点检测的方法进行处理,(Polygonal area is loose on the tank outside the groove loose detection, the use of this program harris corner detection method for processing,)
- 2013-09-08 22:02:08下载
- 积分:1
-
SampleLED
说明: project sampleled new c again
- 2020-05-02 17:19:32下载
- 积分:1
-
计算器源码
/****************************************************************************** Meta object code from reading C++ file "mainwindow.h"**** Created by: The Qt Meta Object Compiler version 67 (Qt 5.9.0)**** WARNING! All changes made in this file will be lost!*****************************************************************************/#include "../../calculator/mainwindow.h"#include #include #if !defined(Q_MOC_OUTPUT_REVISION)#error "The header file "mainwindow.h" doesn"t include ."#elif Q_MOC_OUTPUT_REVISION != 67#error "This file was generated using the moc from 5.9.0. It"#error "cannot be used with the include files from this version of Qt."#error "(The moc has changed too much.)"#endifQT_BEGIN_MOC_NAMESPACEQT_WARNING_PUSHQT_WARNING_DISABLE
- 2022-03-16 18:11:53下载
- 积分:1
-
俄罗斯方块源码
俄罗斯方块vc源码 ,适用最新的vc打开,希望对广大同学有用
- 2023-04-29 21:55:03下载
- 积分:1
-
SKMSystemInfoConfig
基于TinyXml封装的XML文件处理类(XML-based document processing package TinyXml class)
- 2010-09-04 18:06:27下载
- 积分:1
-
MobilePartner.tar
HUAWEI ET128-2 Linux系统下的应用软件(the application of HUAWEI ET128-2 on Linux system)
- 2015-07-22 09:59:05下载
- 积分:1