⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 critsse.m

📁 使用matlab进行实现的kmeans算法。数据集。
💻 M
字号:
function [Je,J] = critsse(x,c);% CRITSSE : computes Sum-of-Squared-Error Criterion for a given clustering% [Je,J] = critsse(x,c)%	x  - d*n matrix of samples%		d - dimension of samples%		n - number of samples%	c  - the 1*n cluster identity for each sample x(:,i)%	Je    - the result%	J     - the result, per cluster (1*nc matrix)% Copyright (c) 1995 Frank Dellaert% All rights Reserved% get dimensions of data[d,n] = size(x);% get number of clustersnc = max(c);% calculate statistics for each cluster, in particular m, the means[nr,m,v] = clusterstats(x,c);% the sum squared error for each cluster is the sum of the variances% times the number of samples in the clusterJ = zeros(1,nc);for j = 1:nc,  J(j) = sum(v(:,j))*nr(j);endJe = sum(J);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -