testadaboost.m

来自「ababoost级联分类器,通过一组弱分类器形成一个强分类器」· M 代码 · 共 48 行

M
48
字号
function [Result,error,H,alpha]=TestAdaBoost(X,Y,C,T,Xver,Yver,WLearner)%%  Test AdaBoost%  %% Input%      X - training set%      Y - label of samples in rtaining set%          1 - belong to the class,0 - otherwise%      C - array of feature vectors %      T - number of iterations%      Xver - verifying dataset %      Yver - correct classification of verifying dataset %           - used to calculate error of classification%      WLearner - weak learner type% Output:%      Result - result classification on verifying set%      error  - error of classification on verifying set       %DEBUG = 1;%learn[H,alpha]=AdaBoost(X,Y,C,T,WLearner);%classifyResult=StrongClassify(Xver,H,alpha,WLearner);N=size(Xver,1);error=sum(abs(Result'-Yver))/N;if DEBUG   % figure(101);imagesc(Result);colormap(gray);title('classification of test set after learning');end;		    		    		    		    		    		    

⌨️ 快捷键说明

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