Forecast a solar-powered tomorrow
Explore a small solar installation and estimate daily energy output.
How much energy could this system produce tomorrow?
A fictional campus wants to understand its solar generation. Explore 60 synthetic daily readings. First calculate an engineering estimate from sunlight hours, then compare a simple regression model using a final time-based test set.
Build it, step by step
- 01
Load the data and check units: sunlight is in hours, temperature in degrees Celsius, and generation in kWh. Inspect missing values and plot generation over day.
- 02
Use rated capacity × sunlight hours × 0.8 as a simple baseline. The installation has a rated capacity of 4.2 kW. Calculate its mean absolute error.
- 03
Use days 1–36 to train and days 37–48 to compare a regression model with the baseline. Use sunlight hours and temperature as features.
- 04
Choose your model before evaluating once on days 49–60. Report test mean absolute error in kWh. Compare residuals across temperature ranges.
- 05
Explain that sunlight and temperature must be forecasts at prediction time. Write down three reasons synthetic performance may not transfer to a real site.
Your project checklist
- A plot with labelled axes and units.
- A baseline and a regression model compared using the same split.
- A final test score reported in kWh, with the test period untouched during model choice.
- A short report about weather forecast error, data limits, and next data to collect.
Free, open and run by a nonprofit.
This page is part of Python to AI, a free course of 20 modules and 60 lessons in the engineering.fit( ) Learning Lab. The Learning Lab is built and run by engineering.fit( ), a nonprofit founded by Abdullateef Opeyemi Bakare that helps African engineering students gain research experience. You do not need an account or pay a fee to learn.