Adaptive Boosting (AdaBoost) Classification: MATLAB, R and Python codes– All you have to do is just preparing data set (very simple, easy and practical)
I release MATLAB, R and Python codes of Adaptive Boosting (AdaBoost) Classification (ABC). They are very easy to use. You prepare data set, and just run the code! Then, ABC and prediction results for new samples can be obtained. Very simple and easy!
You can buy each code from the URLs below.
MATLAB
https://gum.co/RYGs
Please download the supplemental zip file (this is free) from the URL below to run the ABC code.
http://univprofblog.html.xdomain.jp/code/MATLAB_scripts_functions.zip
R
https://gum.co/ovUWC
Please download the supplemental zip file (this is free) from the URL below to run the ABC code.
http://univprofblog.html.xdomain.jp/code/R_scripts_functions.zip
Python
https://gum.co/igWUi
Please download the supplemental zip file (this is free) from the URL below to run the ABC code.
http://univprofblog.html.xdomain.jp/code/supportingfunctions.zip
Procedure of ABC in the MATLAB, R and Python codes
To perform appropriate ABC, the MATLAB, R and Python codes follow the procedure below, after data set is loaded.
1. Decide classification method
Decision tree is used basically. Since AdaBoost is ensemble method, performance of classifiers is not important.
2. Decide the number of classification models
3. Autoscale explanatory variable (X) (if necessary)
Autoscaling means centering and scaling. Mean of each variable becomes zero by subtracting mean of each variable from the variable in centering. Standard deviation of each variable becomes one by dividing standard deviation of each variable from the variable in scaling.
4. Construct AdaBoost model
5. Calculate confusion matrix between actual Y and calculated Y
Accuracy rate, detection rate, precision and so on can be calculated from each confusion matrix, if necessary.
6. In prediction, subtract the mean in the autoscalling of X in 1. from X-variables, and then, divide X-variables by the standard deviation in the autoscalling of X in 1., for new samples, if X is autoscaled in 3.
7. Estimate Y and calculate possibility of each class for new samples, based on AdaBoost model in 4.
How to perform ABC?
1. Buy the code and unzip the file
MATLAB: https://gum.co/RYGs
Python: https://gum.co/igWUi
2. Download and unzip the supplemental zip file (this is free)
MATLAB: http://univprofblog.html.xdomain.jp/code/MATLAB_scripts_functions.zip
R: http://univprofblog.html.xdomain.jp/code/R_scripts_functions.zip
Python: http://univprofblog.html.xdomain.jp/code/supportingfunctions.zip
3. Place the supplemental files at the same directory or folder as that of the ABC code.
4. Prepare data set. For data format, see the article below.
5. Run the code!
Estimated values of Y for “data_prediction2.csv” are saved in ”PredictedY2.csv”. The probability of each class for each estimated value is saved in “PredictedY2_Probability.csv”.
Required settings
Please see the article below.
https://medium.com/@univprofblog1/settings-for-running-my-matlab-r-and-python-codes-136b9e5637a1#.paer8scqy