Classic AdaBoost Classifier
by Dirk-Jan Kroon
01 Jun 2010
(Updated 20 Jan 2012)
Weak threshold classifier boosted to strong Classifier with Adaboost
|
Watch this File
|
| File Information |
| Description |
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:
[estimateclass,model]=adaboost('train',datafeatures,dataclass,itt)
Apply mode:
estimateclass=adaboost('apply',datafeatures,model)
inputs/outputs:
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. |
| MATLAB release |
MATLAB 7.10 (2010a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 01 Jun 2010 |
Changed Screenshot and example figure |
| 30 Aug 2010 |
Solved division by zero, causing NaN |
| 29 Dec 2010 |
Changed bug : ndims(datafeatures)to size(datafeatures,2) |
| 07 Oct 2011 |
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.
|
| 20 Jan 2012 |
Fixed boundary bug |
|
Contact us at files@mathworks.com