?? stronggentleclassifier.m
字號:
function [Cx, Fx] = strongGentleClassifier(x, classifier)
% [Cx, Fx] = strongLogitClassifier(x, classifier)
%
% Cx is the predicted class
% Fx is the output of the additive model
% Cx = sign(Fx)
%
% In general, Fx is more useful than Cx.
%
% The weak classifiers are stumps
% Friedman, J. H., Hastie, T. and Tibshirani, R.
% "Additive Logistic Regression: a Statistical View of Boosting." (Aug. 1998)
% atb, 2003
% torralba@ai.mit.edu
Nstages = length(classifier);
[Nfeatures, Nsamples] = size(x); % Nsamples = Number of thresholds that we will consider
Fx = zeros(1, Nsamples);
for m = 1:Nstages
featureNdx = classifier(m).featureNdx;
th = classifier(m).th;
a = classifier(m).a;
b = classifier(m).b;
Fx = Fx + (a * (x(featureNdx,:)>th) + b); %add regression stump
end
Cx = sign(Fx);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -