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

📄 clbtocl.m

📁 聚类分析工具箱 亚历山大博士写的
💻 M
字号:
% function [cl, index] = clbtocl(clb,p)
%
% copyright (c) 1998-2002 by Alexander Strehl

function [cl, index] = clbtocl(clb,p)
randbreakties = 1;

allzerocolumns = find(sum(clb,1)==0);
if ~isempty(allzerocolumns),
   disp(['clbtocl: ' num2str(length(allzerocolumns)) ' objects (' num2str(100*length(allzerocolumns)/size(clb,2),'%.0f') '%) with all zero associations']);
   clb(:,allzerocolumns) = rand(size(clb,1),length(allzerocolumns));
end;
if randbreakties,
   clb = clb + rand(size(clb))/10000;
end;

clb = norml(clb',1)';
m = max(clb,[],1);
cl = zeros(1,size(clb,2));
winnersprop = zeros(1,size(clb,2));
for i=size(clb,1):-1:1,
  a = find(m==clb(i,:));
  cl(a) = i*ones(1,length(a));
  winnersprop(a) = clb(i,a);
end;

if ~exist('p')
  index = []; 
else
  index = find(winnersprop<p); 
end;
disp(['clbtocl: delivering ' num2str(max(cl)) ' clusters']);
disp(['clbtocl: average posterior prob is ' num2str(mean(winnersprop)) ]);
if (length(cl)<=7),
  disp('clbtocl: winning posterior probs are');
  disp(winnersprop);
  disp('clbtocl: full posterior probs are');
  disp(clb);
end;

⌨️ 快捷键说明

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