100 beginner machine learning projects with runnable Python code, tests and honest case studies. By Networkers Home, Bangalore.
This small reproducible project benchmarks a LightGBM-style histogram boosting classifier at increasing dataset sizes and reports held-out accuracy, training time and a conservative memory estimate. LightGBM itself is not available in the permitted environment; the project therefore uses scikit-learn’s HistGradientBoostingClassifier which follows a similar histogram-based approach and is suitable for teaching the same principles: controlling leaf counts, early stopping and handling a simple categorical feature.
The data are synthetic classification datasets generated with sklearn.datasets.make_classification. For each target row-count the code generates numeric features and one synthetic low-cardinality categorical feature (created by binning a numeric column). These datasets are intentionally small-to-moderate so the whole pipeline runs quickly on typical student machines.
Run the script directly: python project.py The script prints a JSON object containing per-size metrics (train times, a conservative memory estimate in kilobytes, held-out accuracies) and a summary key largest_accuracy.
Run pytest in the project directory: pytest -q The test suite checks that the run() output contains expected keys, that metrics are in plausible ranges and that the main held-out metric is deterministic and above a conservative floor.
Measured by running python project.py (seed 42) on 2026-10-23; the tests in test_project.py assert the floor.
| Metric | Value |
|---|---|
| largest_accuracy | 0.9525 |
| notes | Used scikit-learn HistGradientBoostingClassifier as LightGBM is not available in the restricted environment. Memory is a conservative estimate from numpy array nbytes. |
Also returned (see python project.py output): sizes (3 items), train_times_s (3 items), memory_kb (3 items), accuracies (3 items).
Full case study, build steps and evaluation checks: LightGBM model for large datasets on networkershome.com
Built by Networkers Home · Learn the skills in the AI Engineer Course · Part of 100 AI projects with code