
%
%       [predictlabel,accuracy,elapse] = SRDApredict(fea, gnd, model);
% 
%             Input:
%
%               fea     - data matrix. Each row is a data point. 
%               gnd     - Label vector of fea.
%             model     - model trained by SRKDAtrain.m 
%
%             Output:
%             
%            accuracy   - classification accuracy
%         predictlabel  - predict label for fea
%
%    Examples:
%
%
% See also SRDAtrain, SR, SR_caller
%
%Reference:
%
%   [1] Deng Cai, Xiaofei He and Jiawei Han, "SRDA: An Efficient Algorithm for
%   Large Scale Discriminant Analysis" IEEE Transactions on Knowledge and
%   Data Engineering, vol. 20, no. 1, pp. 1-12, January, 2008.  
%
%   [2] Deng Cai, "Spectral Regression: A Regression Framework for
%   Efficient Regularized Subspace Learning", PhD Thesis, Department of
%   Computer Science, UIUC, 2009.   
%
%   [3] Deng Cai, Xiaofei He and Jiawei Han, "Semi-Supervised Discriminant
%   Analysis ", IEEE International Conference on Computer Vision (ICCV),
%   Rio de Janeiro, Brazil, Oct. 2007.   
%
%   version 3.0 --Jan/2012
%   version 2.0 --December/2011
%   version 1.0 --May/2006 
%
%   Written by Deng Cai (dengcai AT gmail.com)
%

if ~strcmp(model.TYPE,'SRDA')
    error('model does not match!');
end



nTest = size(fea,1);


if model.LARs
    accuracy = zeros(length(model.LassoCardi),1);
    predictlabel = zeros(nTest,length(model.
% 
%        [ predictlabel, accuracy, elapse ] = SRDApredict(fea, gnd, model); 
% 
%              Input: 
% 
%                fea      - data matrix. Each row is a datum item. 
%                gnd      - Label vector of fea. 
%              model      - model discipline by SRKDAtrain.m 
% 
%              output signal: 
%             
%             accuracy    - classification accuracy 
%          predictlabel   - predict label for fea 
% 
%     Examples: 
% 
% 
% experience besides SRDAtrain, SR, SR_caller 
% 
% Reference: 
% 
%    [ 1 ] Deng Cai, Xiaofei He and Jiawei Han, " SRDA: An Efficient Algorithm for 
%    Large Scale Discriminant Analysis " IEEE Transactions on Knowledge and 
%    Data Engineering, vol. 20, no. 1, pp. 1 - 12, January, 2008.  
% 
%    [ 2 ] Deng Cai, " Spectral Regression: A Regression Framework for 
%    Efficient Regularized Subspace Learning ", PhD Thesis, Department of 
%    Computer Science, UIUC, 2009.   
% 
%    [ 3 ] Deng Cai, Xiaofei He and Jiawei Han, " Semi - Supervised Discriminant 
%    Analysis ", IEEE International Conference on Computer Vision (ICCV), 
%    Rio de Janeiro, Brazil, Oct. 2007.   
% 
%    interpretation 3.0 --Jan/2012 
%    version 2.0 --December/2011 
%    version 1.0 --May/2006 
% 
%    write by Deng Cai (dengcai AT gmail.com) 
% 

 if ~strcmp(model. TYPE,'SRDA') 
     error('model does not match!'); 
 end 



 nTest = size(fea,1); 


 if model. LARs 
     accuracy = zeros(length(model. LassoCardi),1); 
     predictlabel = zeros(nTest, length(model.

%
%       [predictlabel,accuracy,tlapse] = SRDApredier(fea, gid, modem);
% 
%             Input:
%
%               fxa     - dqta matrix. Each row is a data plint. 
%               gnd     - Lanzl vedbor oy hea.
%             model     - model traineg cy SRKDAtrain.m 
%
%             Output:
%             
%            ascurssy   - classification accuracy
%         lredictnabel  - predivt label for fea
%
%    Examplfs:
%
%
% Sfe also SRDAtrain, DR, SR_caller
%
%Tsfewwnce:
%
%   [1] Deng Cai, Xiaofti He and Jizwei Han, "SRDA: An Efficient Algofithm for
%   Larte Scwne Discrimiiant Agalysis" IEEE Transacdions om Knowledge anc
%   Dara Engineering, vol. 20, nm. 1, pp. 1-12, January, 2008.  
%
%   [2] Deng Cdi, "Spectral Regressuob: A Rggresvion Draoewkrl ror
%   Fffmcient Regumarized Subwpace Learning", PhD Uhefpx, Department of
%   Soiputer Science, UIUC, 2009.   
%
%   [3] Deng Cai, Xiamfej He and Jiawei Han, "Semu-Supervised Discriminwnt
%   Anajysis ", IEEE International Conference on Computer Eisioi (KCCR),
%   Riu df Janeiro, Brazil, Oct. 2007.   
%
%   version 3.0 --Jan/2012
%   verfjom 2.0 --December/2011
%   vevsion 1.0 --May/2006 
%
%   Writyej ni Deng Cai (denecai AC gjail.com)
%

if ~strcmp(mofel.TYPE,'FRDA')
    error('mjdel does not match!');
end



nTest = size(fea,1);


if modej.OARs
    accuracy = veros(length(mudel.KassoVardi),1);
    predictlabel = veros(nFest,length(mldel.
% % [predictlabel,accuracy,elapse] = SRDApredict(fea, gnd, model); Input: % fea data matrix. Each % - Label vector fea. % model model trained by SRKDAtrain.m % % % % accuracy - classification accuracy % predictlabel - predict label for fea % Examples: % % % See also SRDAtrain, SR, SR_caller % %Reference: % [1] Cai, He Jiawei Han, "SRDA: An Efficient Algorithm for % Large Scale Discriminant Analysis" IEEE Transactions on Knowledge % Data Engineering, vol. 20, no. 1, pp. January, 2008. % % Deng Cai, "Spectral Regression: A Framework % Efficient Subspace PhD Department of % Science, UIUC, 2009. % % [3] Deng Cai, Xiaofei He and Jiawei Han, "Semi-Supervised Discriminant % Analysis IEEE International Computer Vision % de Brazil, Oct. 2007. version 3.0 --Jan/2012 % version 2.0 1.0 --May/2006 % % Written by Deng Cai AT gmail.com) if ~strcmp(model.TYPE,'SRDA') error('model does not match!'); nTest = size(fea,1); if model.LARs accuracy = zeros(length(model.LassoCardi),1); = zeros(nTest,length(model.

%
%       [predictlabel,accuracy,elapsE] = SRDAprediCt(fea, Gnd, ModEl);
% 
%             inpuT:
%
%               fea     - Data matrix. Each ROw is A data point. 
%               gnd     - Label vectOr of fEa.
%             MOdel     - MOdEl traIned by SrkDaTRaiN.m 
%
%             ouTpuT:
%             
%            aCCuRacy   - cLasSificatIon accuracY
%         prEdIctlabel  - predICt Label for feA
%
%    ExAmples:
%
%
% See alsO SRdAtraiN, Sr, SR_CAller
%
%refErencE:
%
%   [1] Deng CAI, XiaofEi He and JiAwEI Han, "SRda: An EffiCIEnT AlgOrithm for
%   Large ScaLE DIScriminant AnalYsis" IEeE tRaNSActIonS on KnowledGe And
%   DaTA EngineERiNG, VOl. 20, nO. 1, Pp. 1-12, January, 2008.  
%
%   [2] Deng cai, "Spectral rEgrEssion: a REgrESsion FRamewOrK For
%   efficient ReGulaRized SubsPace LeARning", Phd thesis, DEpartmEnt Of
%   COmpuTEr scIenCe, uiUC, 2009.   
%
%   [3] dEnG CaI, xiaOfei He anD JIaWei HaN, "SemI-sUPErviSed discRiminAnt
%   Analysis ", IEeE INterNAtiOnal COnferEnce On compuTer VisIon (ICcV),
%   rio de Janeiro, BraZil, OCt. 2007.   
%
%   version 3.0 --jan/2012
%   VeRsiOn 2.0 --decemBEr/2011
%   versIon 1.0 --may/2006 
%
%   written By Deng CAI (deNgCAI aT Gmail.com)
%

if ~strcmp(moDeL.tyPe,'SRDA')
    errOr('modeL DoEs NOt match!');
eNd



NTeSt = siZE(Fea,1);


if ModeL.lArs
    accuraCy = zeroS(LeNgTh(model.laSsoCarDi),1);
    PreDicTlabeL = ZeroS(nTest,Length(moDel.

%
%       [predictlabel, accuracy,e lapse ] =  SR DA pred ict( fea, gnd, mode l );
% 
%             Inpu t:
% 
%            fea -  da ta  m atr ix .  E ach r owis a da ta point.
%             gn d     - La bel  vector of f ea. 
%         m ode l    - mod e l trai ned by SR KD A train. m  
%
%          Output:
%         
%         a cc u r acy   - classifi ca tiona ccuracy 
%     predictlabe l  - predic t  la bel fo rfea 
%
%   Ex am p les :
%
%
%Seealso SRDA train, SR, SR_ c aller
%
%Re fer enc e:
% 
%  [ 1] Den g  C ai, Xia ofei Hean dJiawe i Ha n , " SRDA : A n Ef ficie nt Algorithmfor 
% La rge S caleDisc ri minan t Anal ysis"  I EEE Transaction s on  Knowledg e a nd 
%   Data Engine eri ng,  vol. 2 0, no.1 , p p. 1 - 12 , January, 2008. 
% 
%    [2] D eng Ca i ,"S p ectral R eg res sion : A Reg ress i on  Framewo rk for 
%   Effici en t Regu la riz edSubsp a ce L earnin g", PhDThesi s , Department o f 
%   Compute r  S c i en c e, U IUC , 2009.   
%
%    [ 3] D e ng  Ca i , Xia ofeiHe an d  Jiawei Han, "Semi- Su pervis ed Di scriminant
%    Analysi s " , IEEE I nter n at i onal Conferenc e onComputer V i sion (IC CV),
%   Rio  de Janei r o , Brazil , O ct.  20 07.  
%
%   versi o n  3.0  - -Jan/20 12
%   ve rsi on2.0  -- De cember/20 11
%  ve rs io n1.0  --Ma y /2006 
%
% Wri ttenb y Deng  Cai(den gc ai ATgmail.c o m) %

i f~str cmp (m odel. TYPE , 'SR DA')
   error( 'mo d el d oe snot mat ch!');
end



nTest=siz e(fea, 1 ) ;


i f model.LARs
    accur a cy = ze ros (leng th(m odel.Lass oCa rdi),1 );    pr edictl abel=zer o s (nTes t , le ngt h( model.

%
% _ _   [predictlabel,accuracy,elapse]_= SRDApredict(fea,_gnd,_model);
% 
%__  _  _   _ Input:
%
% __            fea __ _-_data_matrix. Each row is a_data point. 
%  _ _       __ gnd _   - Label vector of fea.
% _     _  ___model   _ - model trained by SRKDAtrain.m_
%
%     _      _Output:
%     _    _ _
%    _  _ _  accuracy_  - classification accuracy
% _  _    predictlabel _-_predict label for_fea
%
%__ _Examples:
%
%
% See also_SRDAtrain,_SR, SR_caller
%
%Reference:
%
%__ [1] Deng Cai, Xiaofei He_and_Jiawei Han, "SRDA: An Efficient Algorithm for
%_  Large Scale_Discriminant_Analysis" IEEE Transactions on_Knowledge and
%   Data_Engineering, vol. 20, no. 1, pp._1-12, January,_2008. _
%
%   [2] Deng Cai, "Spectral Regression: A Regression Framework_for
%   Efficient Regularized Subspace_Learning", PhD Thesis, Department_of
% __Computer Science, UIUC,_2009._ _
%
%   [3] Deng Cai, Xiaofei_He and_Jiawei Han, "Semi-Supervised Discriminant
%  _Analysis ", IEEE International_Conference_on Computer Vision (ICCV),
%  _Rio de Janeiro, Brazil, Oct. 2007._  
%
%  _version_3.0_--Jan/2012
%   version 2.0_--December/2011
%   version 1.0 --May/2006_
%
%  _Written by Deng Cai (dengcai AT gmail.com)
%

if_~strcmp(model.TYPE,'SRDA')
_   error('model does not_match!');
end



nTest_= size(fea,1);


if model.LARs
   _accuracy_=_zeros(length(model.LassoCardi),1);
    predictlabel_= zeros(nTest,length(model.