Back to Projects

Machine Learning Coursework

Weekly Price Forecasting

A time-series coursework exercise using weekly avocado prices across regions and product types. I constructed next-week targets and lag features, used a chronological train/test split, and compared Random Forest predictions with a baseline that reuses the current price.

Period

Jan - Apr 2026

Tools / Tech

PythonPandasScikit-learnRandom ForestLag Features

Why I built it

I wanted to understand how forecasting differs from a random train/test split, especially when the dataset contains several related time series.

Links

What it includes

  • Groups observations by region and product type before creating lagged prices.
  • Adds calendar features and compares train/test R-squared with a persistence baseline.

What I worked on

  • Wrote the data exploration, grouped lag construction, and Random Forest experiment myself within the course notebook.
  • Checked timestamp spacing and compared the model with a simple forecast before interpreting its score.

What I Learned

  • Practiced aligning features and future targets within each series.
  • Learned how a strong simple baseline changes the way a forecasting result should be interpreted.