function [lb] = LogitBooster(rg) constructor of the LogitBooster class that inherits from the classifier class. the LogitBooster implements the LogitBoost boosting algorithm to build a strong (boosted) classifier from several weak classifiers. Inputs: rg: the regressor needed to for logitboost numClasses: number of classes
0001 function [lb] = LogitBooster(rg, numClasses) 0002 % function [lb] = LogitBooster(rg) 0003 % constructor of the LogitBooster class that inherits from the classifier 0004 % class. the LogitBooster implements the LogitBoost boosting algorithm to 0005 % build a strong (boosted) classifier from several weak classifiers. 0006 % 0007 % Inputs: 0008 % rg: the regressor needed to for logitboost 0009 % numClasses: number of classes 0010 0011 0012 % parameters needed for training 0013 % the error bound after reaching which the classifier stops learning, 0014 % used only when the nStages argument to learn is Inf 0015 lb.errBound = 0.001; 0016 0017 % paramters needed to define the classifier 0018 if nargin == 0 0019 lb.regressor = Nan; 0020 else 0021 lb.regressor = rg; 0022 end 0023 0024 lb.nStages = 0; 0025 0026 % 1. number of classes 0027 lb.numClasses = numClasses; 0028 0029 % 2. example weights of the last iteration of LogitBoost learning 0030 % algorithm. this is saved after training the classifier to be used 0031 % later if we want to increase the number of stages later on 0032 lb.lastExWeights = []; 0033 0034 % 3. the threshold whereby the classifier can distinguish between the 0035 % positive and negative examples 0036 lb.thresh = NaN; 0037 0038 % 4. detection rate after training 0039 lb.detectionRate = NaN; 0040 0041 % 5. F matrix (J,n) (j number of classes, n is the number of features) 0042 lb.F = NaN; 0043 0044 % 6. P matrix (m, n) (m number of instances , n is the number of features) 0045 lb.P = NaN; 0046 0047 lb = class(lb, 'LogitBooster', Classifier(numClasses));