资源简介

量子聚类matlab代码包,内附相关算法资料,希望对大家有所帮助~

资源截图

代码片段和文件信息

function [minkowski_measurejacard_measurepurityefficiency]=clustmeasure(clustrealClust)
% function [minkowski_measurejacard_measurepurityefficiency]=clustmeasure(clustrealClust)
% input: clust=vector with all the cluster # of each data point
%        realClust=vector ofthe starting place of each cluster 
%        (assuming the data points are sorted accordingly)

pNum=length(clust);
% S=the clutering result in pairs - S(ij)=1 iff data point i and j are asigned to the same cluster
S=(repmat(clust1pNum)==repmat(clust‘pNum1));
for i=1:(length(realClust)-1);
    t(realClust(i):(realClust(i+1)-1))=i;
end
l=length(clust);
t(realClust(i+1):l)=i+1;
T=(repmat(t‘1l)==repmat(tl1));
% T=the true clutering (same definition as for S)


sum(sum(T==1));
sum(sum(T~=S));
minkowski_measure=sqrt(sum(sum(T~=S))/sum(sum(T==1)));
S1=S*2-1; % replace 0 for -1
TP=(T==S1); % all palces where both T and S equal 1
jacard_measure = sum(sum(TP))/(sum(sum(T~=S))+sum(sum(TP)));

efficiency = sum(sum(TP))/sum(sum(T==1)); % n11/(n10 + n11)
purity=      sum(sum(TP))/sum(sum(S==1)); % n11/(n01 + n11)




 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     114000  2010-12-16 21:39  QC\Algorithm for data clustering in pattern recognition problems based on quantum mechanics.pdf

     文件       1132  2002-05-25 22:36  QC\clustMeasure.m

     文件        588  2002-05-25 22:29  QC\fineCluster.m

     文件        644  2002-05-25 22:27  QC\graddesc.m

     文件        271  2002-05-25 22:29  QC\plotClust.m

     文件       2150  2002-05-25 22:37  QC\qc.m

     文件       1371  2002-05-25 23:15  QC\QCscript.m

     文件     459920  2002-05-25 22:43  QC\spellman-demo.mat

     目录          0  2010-12-22 10:34  QC

----------- ---------  ---------- -----  ----

               580076                    9


评论

共有 条评论