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

📄 classifyer_angel_ica.m

📁 ICA is used to classify text in extension to the latent semantic indexing framework. ICA show to ali
💻 M
字号:
function [ClassEstimats,ClassEstimatsRec]=classifyer_angel_ica(S,Frac);
% Classify the output of ICA using the largest value for a given document
% as class.

if nargin<2,
   Frac=0;
end

AllZeros=0;
LessDiff=0;
for i=1:size(S,2),
   [s,si]=sort(S(:,i));
   s=flipud(s);
   si=flipud(si);
   if s(1)==0,
      ClassEstimats(i,1)=size(S,1)+1;
      AllZeros=AllZeros+1;
   else
      ClassEstimats(i,1)=si(1);
      
      % reject class
      for j=2:length(s),
         %if s(j)>=s(1)-Frac,                               % NB! for softmax
         if abs(s(1)-s(j))/abs(s(1)+s(j))<Frac,
            ClassEstimats(i,1)=length(s)+1; 
            LessDiff=LessDiff+1;
            ClassEstimatsRec(i,j)=si(j);
         end
      end
   end
   
end

ClassEstimats=ClassEstimats';

disp(sprintf('Class - all zeros:%d    less frac diff:%d    = rejected:%d',AllZeros,LessDiff,AllZeros+LessDiff))

⌨️ 快捷键说明

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