Collect trustworthy prices
Observed Calgary unleaded retail prices. Weekends were not created or interpolated.
Translate data into decisions
Understand price persistence, volatility and next-recorded-day forecasting limitations.
Support practical operations
Inform fuel budgeting and purchasing with human oversight.
01 — Data Overview, Wrangling & Transformation (DP1–DP3)
Original source
1,516 recorded weekday gasoline prices from Jan 1, 2021 to Oct 23, 2026. Units: cents/litre. Source licence must be confirmed prior to public redistribution.
Inspect quality
Confirm dates, 0 missing prices, 0 duplicate dates, extremes and time trends; preserve original data.
Historical features
Lags 1, 2, 3, 5; previous-five rolling mean/std; last price change. Each feature uses earlier records only.
Scale and split
1,208 earlier training rows (Jan 8, 2021–Aug 26, 2025), then 303 validation rows (Aug 27, 2025–Oct 23, 2026). No shuffling. Training-only z-score scaling.
Historical price series
Training / validation split
Selected features, X
lag_1 lag_2 lag_3 lag_5 rolling_mean_5 rolling_std_5 change_lag1_vs_lag2
Target y: price for the next recorded date, ¢/L. First five rows do not have complete feature history.
02 — Model training
Trained Linear Regression, Decision Tree, Random Forest, Gradient Boosting and an additional Ridge Regression. Compared each with a last-known-price baseline. Simple models are often effective because prices persist from one recorded day to the next.
| Model | MAE (¢/L) | RMSE | MedAE | RMSLE |
|---|
03 — Independent chronological validation
Actual versus predicted prices
Forecast error, every model
Lower is better. Linear Regression ranked first by MAE (3.320 ¢/L), while Ridge ranked first by RMSE.
04 — Interactive forecasting application
Enter five past recorded prices
Provide dated historical observations in ascending order (oldest first). Only previously observed prices are used. Weekend dates are not accepted because the source contains weekday observations.
The seven engineered features are standardized with training-set means and standard deviations and evaluated with the saved Linear Regression parameters. The 90% empirical uncertainty band uses the 90th percentile of absolute errors on the 303 historical validation days. It is not a calibrated guarantee for a changed market.
How predictions work
- Sort and validate five strictly increasing, weekday-only historical dates.
- Build lag 1, 2, 3 and 5 from the five entered prices.
- Calculate previous-five mean, standard deviation (population), and lag 1 minus lag 2.
- Apply training-only standardization and the actual fitted model parameters.
- Show the next weekday date (Monday after Friday) and predicted price.
Forecast horizon: the next recorded weekday—not an arbitrary calendar day. Excludes holiday and data-provider reporting exceptions; this app assumes Monday–Friday cadence. The estimate is not a guaranteed pump price.
05 — AI governance and deployment
Governance checklist
Deployment readiness
Operational concept: record each new observed weekday price; refresh inputs; forecast the next recorded day; log predictions and later compare them with actual prices.
Monitor: trends in error and market regime change. Investigate retraining if rolling error consistently exceeds the baseline.
06 — Historical report generator
Download date-filtered fuel-price history
Select a recorded date range to export historical observations and, where available, saved validation predictions and forecast errors.
Report coverage
Raw history: 1,516 actual observations (Jan 2021–Oct 2026). Validation: predictions for 303 later observations (Aug 2025–Oct 2026). The historical report separates actuals from saved model predictions and shows missing predictions as blank for earlier dates.
Forecast target: next recorded weekday, not arbitrary dates far into the future. Values use cents per litre.
07 — Download all project files
All CSV files and the original trained-model archive are embedded in this standalone HTML. Downloads work without internet or a web server.
To review independently, compare exported figures against the original dataset and obtain human approval before publication.