This project focuses on forecasting future sales using historical retail data from the Superstore dataset. A Random Forest regression model is used along with time-series feature engineering to capture patterns and generate future predictions.
-
Time series forecasting on real-world retail data
-
Feature engineering:
- Extraction of month and year
- Lag features (lag1, lag2)
- Rolling mean (3-step average)
-
Random Forest Regressor
-
Train-test split without shuffling (time-series aware)
-
Confidence interval visualization
-
Multi-step forecasting for the next 12 months
The following visualizations are generated and stored in the outputs/ directory:
- Sales trend over time
- Actual vs predicted comparison
- Forecast with confidence interval
- Future sales forecast
- Python
- Pandas
- NumPy
- Matplotlib
- Scikit-learn
FUTURE_ML_01/
│
├── data/
│ └── Sample - Superstore.csv
├── outputs/
│ ├── advanced_forecast.png
│ ├── data_plot.png
│ └── future_forecast.png
├── src/
│ ├── Sample - Superstore.csv
│ └── task1.py
├── .gitignore
├── LICENSE
├── README.md
Run the main script from the project root directory:
python src/task1.py
The model is able to capture underlying trends in the sales data and generate reasonable forecasts. The use of lag features and rolling statistics improves predictive performance on time-dependent data.
Samarpit Gujral