100 beginner machine learning projects with runnable Python code, tests and honest case studies. By Networkers Home, Bangalore.
This project trains a simple, reproducible regression baseline to forecast hourly energy consumption for a single aggregate meter. The pipeline demonstrates building lag features, using an as-issued weather input (a forecast column that is not replaced by future true observations), and comparing a trained regression model against a operational baseline: same-hour-last-week demand. The project evaluates chronological mean absolute error (MAE), peak-period errors and holiday-period errors, and emits lightweight warnings for missing-meter readings and stale weather inputs. The project uses a synthetic but realistic hourly dataset created inside the code (see Data section).
The data are synthetic and generated inside the project using numpy and pandas to mimic permissioned aggregate meter readings with calendar context and an as-issued hourly temperature forecast. The dataset contains hourly timestamps for a year plus two weeks, a true consumption value, a forecast temperature column (the as-issued weather used in production), and holiday markers. A small fraction of meter readings and forecast timestamps are marked to trigger the missing-meter and stale-input warnings.
Run the project script directly. The script defines run(seed: int = 42) and the main block prints the output JSON:
python project.py
Tests are provided with pytest. To run the tests:
pytest -q
The tests check presence of keys, reasonable metric ranges, determinism and a conservative main-metric floor.
Full case study, build steps and evaluation checks: Energy consumption predictor on networkershome.com
Built by Networkers Home · Learn the skills in the AI Engineer Course · Part of 100 AI projects with code