- 博客(1)
- 资源 (3)
- 收藏
- 关注
转载 查询及删除重复记录的方法大全
1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断select * from peoplewhere peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有
2007-04-27 08:07:00 652
C#文本聚类算法实现
一个基于C#的文本聚类算法
/// <summary>
/// 该聚类的数据成员索引
/// </summary>
internal List<int> CurrentMembership = new List<int>();
/// <summary>
/// 该聚类的中心
/// </summary>
internal double[] Mean;
/// <summary>
/// 该方法计算聚类对象的均值
/// </summary>
/// <param name="coordinates"></param>
public void UpdateMean(double[][] coordinates)
{
// 根据 mCurrentMembership 取得原始资料点对象 coord ,该对象是 coordinates 的一个子集;
//然后取出该子集的均值;取均值的算法很简单,可以把 coordinates 想象成一个 m*n 的距阵 ,
//每个均值就是每个纵向列的取和平均值 , //该值保存在 mCenter 中
for (int i = 0; i < CurrentMembership.Count; i++)
{
double[] coord = coordinates[CurrentMembership[i]];
for (int j = 0; j < coord.Length; j++)
{
Mean[j] += coord[j]; // 得到每个纵向列的和;
}
for (int k = 0; k < Mean.Length; k++)
{
Mean[k] /= coord.Length; // 对每个纵向列取平均值
}
}
}
2011-02-19
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人