Classic AdaBoost Classifier

版本 (4.1 KB) 作者: Dirk-Jan Kroon
Weak threshold classifier boosted to strong Classifier with Adaboost

19.6K 次下载

更新时间 2012/1/20


This a classic AdaBoost implementation, in one single file with easy understandable code.

The function consist of two parts a simple weak classifier and a boosting part:
The weak classifier tries to find the best threshold in one of the data dimensions to separate the data into two classes -1 and 1
The boosting part calls the classifier iteratively, after every classification step it changes the weights of miss-classified examples. This creates a cascade of "weak classifiers" which behaves like a "strong classifier"
Training mode:
Apply mode:

datafeatures : An Array with size number_samples x number_features
dataclass : An array with the class off all examples, the class
can be -1 or 1
itt : The number of training iterations
model : A struct with the cascade of weak-classifiers
estimateclass : The by the adaboost model classified data

Please leave a comment, if you like the code, find a bug or have a suggestion.


Dirk-Jan Kroon (2023). Classic AdaBoost Classifier (, MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2010a
Windows macOS Linux
Help CenterMATLAB Answers 中查找有关 Classification 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明

Fixed boundary bug

Speed improvement (Replaced loops by 1D indexing and bsxfun operations.)
The function now limits features of the test data to the outer-boundaries of training data.

Changed bug : ndims(datafeatures)to size(datafeatures,2)

Solved division by zero, causing NaN

Changed Screenshot and example figure