📄 error_thing.m
字号:
function err_rate=error_thing(True_Y,Y)% function err_rate=error_thing(True_Y,Y)%% Computes the error rate for Clustering%% Clustering Through Ranking On Manifolds% Version 0.2%% Copyright by Markus Breitenbach and Gregory Z. Grudic% This code is for your personal and research use only.%% http://www.cs.colorado.edu/~grudic/% http://ucsu.colorado.edu/~breitenm/%% This software is provided "as is," without warranty of any kind, express% or implied. In no event shall the authors be held liable% for any direct, indirect, incidental, special or consequential damages% arising out of the use of or inability to use this software.% fprintf(1,'error thing external\n'); nGroups = size(True_Y,2); tab=crosstab(True_Y*(1:nGroups)',Y*(1:nGroups)'); xmax=max(tab); dcount=1; for i=1:length(xmax) xx=find(tab(:,i)==xmax(i)); if length(xx)>1 myperm(i)=xx(dcount); dcount=dcount+1; else myperm(i)=xx(1); end; end; for i=1:length(myperm) xx=find(myperm==i); if length(xx)<1 xmyperm(i)=1; else xmyperm(i)=xx(1); end; end; %myperm=xmyperm; tab=[tab(:,xmyperm), tab] if length(myperm)~=nGroups myperm = 1:nGroups; fprintf(1,'Error with the error thing\n'); end; True_Y=True_Y(:,myperm); errors = abs(Y - True_Y); err_ind = find(sum(abs(Y - True_Y)')'>0); num_errors = length(err_ind); err_rate = num_errors / length(True_Y) *100; fprintf(1,'\t Error rate %f\n',err_rate);return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -