Rossmann operates over 3,000 drug stores in 7 European countries. In this Kaggle competition, the task is to forecast daily sales for 6 weeks across 1,115 Rossmann stores in Germany. Accurate forecasts help store managers improve planning and resource allocation.
This project implements a complete machine learning pipeline to tackle this business problem, including:
- Data Cleaning
- Exploratory Data Analysis
- Feature Engineering
- Model Training
- Ensemble Learning
- Final Submission to Kaggle
- Historical sales data from 2013–2015.
- Includes Store ID, Sales, Customers, Open/Closed status, and Promotion info.
- Same structure as
train.csvwithout Sales. - Used for making final predictions.
- Store metadata: StoreType, Assortment level, Competition distance, Promo2 status, etc.
- Format template to structure predictions for Kaggle evaluation.
- Merged
train.csvandtest.csvwithstore.csvon theStorecolumn.
- Filled missing numerical values with median (e.g.
CompetitionDistance). - Filled
PromoIntervalwith the most frequent value.
- Extracted
Day,Month,Yearfrom theDatecolumn. - Filtered training data to include only rows where stores were open (
Open == 1).
- Visualized sales distributions.
- Examined relationships between
SalesandPromo,DayOfWeek,Month,Year. - Generated a correlation heatmap to identify feature relationships.
- Applied MinMaxScaler to normalize numeric features.
- Applied OneHotEncoder to convert categorical columns into numeric format.
Trained a variety of models:
- Linear Models: Linear Regression, Ridge, Lasso, ElasticNet
- Tree-Based Models: Decision Tree, Random Forest
- Combined Ridge, Decision Tree, and Random Forest predictions using weighted averaging.
- Weights:
0.6 * RandomForest + 0.3 * DecisionTree + 0.1 * Ridge
- RMSE: Root Mean Squared Error
- RMSPE: Root Mean Square Percentage Error (used by Kaggle)
| Model | RMSE | RMSPE |
|---|---|---|
| RandomForest | 1154.43 | 18.74% |
| DecisionTree | 1469.77 | 21.88% |
| Ridge | 2718.66 | 48.44% |
| Ensemble | 1306.09 | 18.76% |
Visualized top 10 features contributing to each model's prediction using bar charts.
- Predictions were made on the test set.
- Final results were stored in
submission.csvas per Kaggle format:
csv
Id,Sales
1,5263.0
2,6064.0
...
Rossmann-Sales-Forecasting/
├── data/
│ ├── train.csv
│ ├── test.csv
│ ├── store.csv
│ └── sample_submission.csv
│
├── notebooks/
│ └── Rossmann_Sales_Forecasting.ipynb
│ └── Updated_Rossmann_Sales_Forecasting.ipynb
|
├── outputs/
│ └── submission.csv
│
├── README.md
└── .gitignore