资源简介
一种K-Means聚类的增加型算法,消除了K-Means算法进行聚类的不确定性。
代码片段和文件信息
#include “Utils.h“
#include
#include
#include
#include
/////////////////////
// DATA GENERATION //
/////////////////////
/**
* A data generator.
**/
class AbstractGen {
public:
virtual vector generateData(ostream &out) const = 0;
};
/**
* Generates a collection of points according to the following scheme:
* - Choose numCenters centers uniformly at random in a hypercube.
* - Choose numPoints/numCenters points offset by a normal distribution from each center.
**/
class SeparateNormalGen: public AbstractGen {
private:
int myNumPoints myNumCenters myNumDims;
Scalar myCenterRange myClusterStdDev;
public:
SeparateNormalGen(int numPoints int numCenters int numDims Scalar centerRange
Scalar clusterStdDev) {
myNumPoints = numPoints; myNumCenters = numCenters; myNumDims = numDims;
myCenterRange = centerRange; myClusterStdDev = clusterStdDev;
}
vector generateData(ostream &out) const {
// Generate the data
vector data;
vector realCenters;
for (int i = 0; i < myNumCenters; i++) {
Point normCenter = getRandomPoint(myNumDims) * myCenterRange;
realCenters.push_back(normCenter);
for (int j = 0; j < myNumPoints/myNumCenters; j++)
data.push_back(getByNormDist(normCenter myClusterStdDev));
}
// Report general info about the data set
out << “SEPARATE NORMAL DISTRIBUTIONS“ << endl;
out << “=============================“ << endl << endl;
out << “Number of points: “ << myNumPoints << endl;
out << “Number of centers: “ << myNumCenters << endl;
out << “Number of dimensions: “ << myNumDims << endl;
out << “Cluster center range in each dimension: “ << myCenterRange << endl;
out << “Intra-cluster standard deviation: “ << myClusterStdDev << endl;
out << “\“Real\“ potential: “ << getKMeansPotential(data realCenters) << endl << endl;
// Return the data set
return data;
}
};
/**
* Generates a collection of points uniformly at random in a hypercube.
**/
class UniformGen: public AbstractGen {
private:
int myNumPoints myNumDims;
Scalar myRange;
public:
UniformGen(int numPoints int numDims Scalar range) {
myNumPoints = numPoints; myNumDims = numDims;
myRange = range;
}
vector generateData(ostream &out) const {
// Generate the data
vector data;
for (int i = 0; i < myNumPoints; i++)
data.push_back(getRandomPoint(myNumDims) * myRange);
// Report general info about the data set
out << “UNIFORMLY RANDOM DATA“ << endl;
out << “=====================“ << endl << endl;
out << “Number of points: “ << myNumPoints << endl;
out << “Number of dimensions: “ << myNumDims << endl;
out << “Range in
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 15457 2006-07-01 13:42 cloud(10).txt
文件 15447 2006-07-01 13:43 cloud(25).txt
文件 15388 2006-07-01 13:43 cloud(50).txt
文件 104652 2006-05-19 13:05 cloud_input.txt
文件 16685 2006-07-01 15:55 intrusion(10).txt
文件 16730 2006-07-01 15:55 intrusion(25).txt
文件 15636 2006-07-01 15:55 intrusion(50).txt
文件 61223560 2006-07-01 15:54 intrusion_input.txt
文件 15275 2006-06-18 09:49 norm10(10).txt
文件 15147 2006-06-18 09:49 norm10(25).txt
文件 15186 2006-06-18 09:46 norm10(50).txt
文件 15017 2006-06-18 09:43 norm25(10).txt
文件 15046 2006-06-18 09:42 norm25(25).txt
文件 15133 2006-06-18 09:35 norm25(50).txt
文件 15211 2006-07-01 15:55 spam(10).txt
文件 15143 2006-07-01 15:55 spam(25).txt
文件 15183 2006-07-01 15:56 spam(50).txt
文件 703084 2006-07-01 13:45 spam_input.txt
文件 18074 2006-07-01 15:48 Main.cpp
文件 11037 2006-06-18 09:41 Utils.cpp
文件 2096 2006-06-17 09:19 Utils.h
相关资源
- ISODATA及K-means聚类算法
- 卢浮宫博物馆人员疏散模型
- K-Means图像分割算法实现
- K-means.rar
- k-means++ the advantages of careful seeding
- Data clustering-50 years beyond K-means
- K-Means 算法demo
- 基于K-Means算法的雷达信号与分选方法
- k-means算法代码
- BOWBag of words,词袋模型代码实现
- 基于 K-means 聚类算法的图像区域分割
- 数据集bank.arff
- 各种聚类程序,包括生成聚类树、k
- k-means数据
- 基于特征选择的K-means聚类异常检测方
- K-means聚类数据.rar
- k-means优化算法
- 中文文本预处理;k-means聚类
- kemans聚类用的数据--包含多个数据
- 机器学习-K-MEANS聚类
- 基于K-means聚类的图像分割
- k-means算法二维坐标数据
- MapReduce下的k-means算法实验报告广工
- Multi-View K-Means Clustering on Big Data
- Charles Elkan的快速k-means算法的代码
- K-均值聚类实现路标检测
- K-medoids聚类源代码K-means改进
- 关于k-means的一篇好的总结论文
-
Efficient Graph-ba
sed Image Segmentation & - 多种K-means聚类算法或改进算法包,
评论
共有 条评论