Khansa, home
Work with me

Jump to

Pages

Projects

Links

Lesson 8 of 8, about 20 minutes

Time series forecasting practice projects with free datasets

Now put it all together. Pick one project, follow the same recipe as in the lessons, and write down what you find. A finished project with a clear story is worth more than ten half-finished notebooks.

By the end: Build a real forecasting project and show it with a clear story.

The recipe for every project

1. Plot the data and describe it in two sentences. 2. Clean it: dates, gaps, outliers. 3. Split by time and keep a final test window. 4. Build the seasonal naive baseline. 5. Try ETS and SARIMAX, and one machine learning model. 6. Backtest and compare with MASE. 7. Show the forecast with its range and explain it in plain words.

Project 1: Airline passengers (easiest)

Monthly passengers from 1949 to 1960. A clear trend and a clear yearly season (m = 12), which makes it perfect for learning. Load it with seaborn: sns.load_dataset("flights").

Python
import seaborn as sns
import pandas as pd

f = sns.load_dataset("flights")
f["date"] = pd.to_datetime(f["year"].astype(str) + "-" + f["month"].astype(str), format="%Y-%b")
s = f.set_index("date")["passengers"].asfreq("MS")
s.plot()

Project 2: Carbon dioxide in the air

Weekly CO2 readings from Mauna Loa. A smooth upward trend with a yearly wave. It is built into statsmodels: from statsmodels.datasets import co2. Practise decomposition and forecast the next two years. A good challenge is the missing weeks.

Project 3: A stock market index

Download daily prices for the S&P 500 with the yfinance package. Prices are close to a random walk, so this is an honest lesson in humility: compare every model with the naive forecast and see how hard it is to beat. Forecast daily returns instead of prices and check whether anything beats zero.

Project 4: Your own data

The best portfolio project uses data nobody else has. Forecast your own monthly spending, your steps, a small shop’s sales or your website visits. Even 100 data points are enough to practise the full recipe.

How to present it

Put the project in a notebook and a short README on GitHub. Start with the question, show one clear chart of the forecast with its range, list your scores against the baseline, and end with what you would do next. Share it on LinkedIn with the chart.

Where you will use this

  • A portfolio project for data science job and PhD applications
  • A talking point in interviews: "I beat the baseline by 18% on a backtest"
  • A starting point for a real forecasting tool for a small business

Common mistake: Do not report one lucky score. Always show the baseline next to your model, and say how many windows you tested on.

Try it yourself

Pick Project 1 today. Finish steps 1 to 4 of the recipe. That alone is a solid first notebook.

Check yourself

Which model should every project be compared with?

The seasonal naive baseline (or naive if there is no seasonality).

What makes a project stand out?

A clear question, an honest backtest against a baseline, and a forecast shown with its range.