100 beginner machine learning projects with runnable Python code, tests and honest case studies. By Networkers Home, Bangalore.
This small teaching project demonstrates AdaBoost (ensemble boosting) using shallow decision-tree weak learners (stumps). It fits AdaBoostClassifier on a synthetic binary classification problem, inspects staged predictions across boosting rounds, and measures sensitivity to controlled label noise. The example emphasises how AdaBoost reweights examples and how that affects held-out error and the weights assigned to weak learners.
The data are synthetic and created with scikit-learn’s make_classification. I build a moderately separable binary problem (800 rows, 10 numeric features). A controlled label-noise experiment is created by flipping a fixed fraction of training labels to simulate noisy annotation.
Run the module as a script: python project.py. The script prints a JSON object with the experiment metrics. The run(seed: int = 42) function can be imported and called from other code or tests.
This project includes pytest tests (test_project.py). Tests verify the expected keys, sensible numeric ranges, a conservative metric floor on held-out accuracy for the clean training case, and determinism (run(seed) produces the same output on repeated calls).
Measured by running python project.py (seed 42) on 2026-10-23; the tests in test_project.py assert the floor.
| Metric | Value |
|---|---|
| final_accuracy_clean | 0.8550 |
| best_accuracy_clean | 0.8650 |
| best_round_clean | 17 |
| final_accuracy_noisy | 0.7950 |
| best_accuracy_noisy | 0.8100 |
| best_round_noisy | 43 |
| noise_rate | 0.2000 |
| n_estimators | 50 |
Also returned (see python project.py output): weak_weights (50 items).
This uses synthetic data which is useful for teaching but not a substitute for a real domain dataset. The label-noise model is a simplistic simulation (random flips) and does not capture structured or adversarial noise. The experiment uses a single dataset split (with reproducible random seed); additional cross-validation would give a more robust assessment.
Full case study, build steps and evaluation checks: AdaBoost algorithm implementation on networkershome.com
Built by Networkers Home · Learn the skills in the AI Engineer Course · Part of 100 AI projects with code