Projects / Predictive Modeling

Global Superstore: Sales Analysis & Forecasting

Exploratory analysis of four years of retail sales, followed by SARIMA forecasting. Daily forecasts turned out to be unusable, so the model was moved to monthly data, where it captures seasonality but is judged on only a short test window.

  • Python
  • pandas
  • Plotly
  • statsmodels
  • pmdarima
  • SARIMA
Daily RMSE
~853
Daily MAPE
~126%not reliable
Monthly RMSE
~13,436
Monthly MAPE
~19%3-month test window

Visual evidence

Select any image to enlarge. Use the arrow keys to move between images.

Dataset
Global Superstore sales data (public, Kaggle)
Size
9,800 records, 18 features, daily orders from 2015 to 2018
Source
Kaggle, rohitsahoo

Business problem

Retail planning (stock, staffing, marketing timing) depends on knowing when demand peaks. This project asks what patterns exist in the sales history and whether they are stable enough to forecast, and at what level of detail forecasting is worth trusting.

Dataset

A retail transaction table with order and ship dates, customer segment, region, product hierarchy and sales. It has 9,800 records and 18 features covering 2015 to 2018.

Limitations:

  • Only four years of history, which gives few full seasonal cycles to learn from.
  • A public sample dataset, so findings describe this data and not a real business.
  • Outliers were handled by replacing them with the monthly mean. That reduces distortion but also hides genuine spikes.

Analytical workflow

  1. Validation and cleaning. Missing values checked, duplicates removed, data types fixed, outliers treated.
  2. Transformation. Dates converted and split into year, month, day and weekday. Daily data aggregated to monthly for forecasting.
  3. Exploratory analysis. Seasonality, weekday pattern, category, region and city performance.
  4. Diagnostics. Stationarity checks, ACF/PACF and seasonal decomposition.
  5. Modelling. SARIMA with parameters chosen by Auto-ARIMA (seasonal period 12), evaluated with RMSE and MAPE on a time-ordered split.

Business insights

  • Sales are strongly seasonal, with the highest peaks in November and December.
  • Sales show mid-week spikes and the lowest levels at weekends.
  • Technology leads revenue; the West and Northeast are the strongest regions; New York and Los Angeles are the top cities.
  • There is a mild upward trend from 2015 to 2018.

What a stakeholder could do: plan stock and campaigns earlier ahead of Q4, and use monthly forecasts for budgeting while treating daily forecasts as unreliable. These are planning ideas, not tested actions.

Methodology and technical decisions

  • Why monthly, not daily. Daily sales were too noisy: the daily model could not follow volatility and produced a MAPE of about 126%. Aggregating to monthly exposed a stable trend and seasonality.
  • Why SARIMA. It handles yearly seasonality directly, needs no outside variables, and its behaviour can be explained. Holt-Winters was considered as a backup.
  • Time-ordered split. Training on January 2015 to September 2018 and testing on October to December 2018, with no shuffling, so the model is never tested on data from before its training period.

Results and limitations

  • Daily forecast: not usable. RMSE about 853 and MAPE about 126%.
  • Monthly forecast: moderate. RMSE about 13,436 and MAPE about 19%. The repository describes this as strong. I read it more cautiously: the test window is only three months, so one unusual month can move the score a lot, and there is no cross-validation across several periods.
  • The forecast starts flat in the first year because of how seasonal terms are initialised.
  • No external drivers such as promotions or holidays were included.
  • None of these results should be read as evidence of highly accurate forecasting.

Disclaimer. Personal portfolio project on a public dataset. Forecasts were not used for any real decision.

Interested in work like this?

Tell me about your data and the decision you need to make.

Send me a message

Choose how you'd like to email mostafiz.r.afraim@gmail.com