This is a code for AdaBoost via Weighted Least Squares.
I used breast cancer datasets from sk-learn. choose 80% of data as training data and 20% of data as test data. confusion matrix of test data is as follows. It showed accuracy of 95.6%.
|Actual class|--Predic class---|
|------------|Positive|Negative|
|--Positive--|---43---|----4---|
|--Negative--|----1---|---66---|
Initialize weights for n = 1, ..., N
for m = 1, ..., M
calculate error rate and reliablity
update weights
make a predictor