Downloads · 30 days
0
talcabalo/weekly-sales-prediction-et-model
weekly-sales-prediction-et-model is a machine learning model from talcabalo. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
<iframe width="560" height="315" src="https://www.youtube.com/embed/j-wl1eWXPtA?si=YqVcC9vzCuyrWLRW" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyros…
Downloads · 30 days
0
Access
Public
Updated Mar 22, 2026
Repo size
143 MB
Likes
0
Public
Click a slice to open those files.
.pkl141 MB · 96%
From the Hugging Face model README
This project analyzes weekly store-level sales using the Walmart Retail Dataset.
The dataset includes sales history, store metadata, and economic indicators such as CPI, Fuel Price, Temperature, and Unemployment.
All files (train.csv, features.csv, stores.csv) were merged into a unified analytical dataset.

A comprehensive EDA was conducted to understand structure, patterns, seasonality, and correlations.
Analyses performed:






Key Insights:
Sales show strong seasonal behavior, high variability between stores, and significant holiday effects.
Advanced feature engineering was applied to improve predictive power.
Month, Week, DayOfYearSize × DeptLog_Weekly_SalesCluster_ID + cluster distances


Insight:
Engineered features improved the model's ability to capture store structure, seasonality, and complex interactions.
A simple Linear Regression model trained on the raw dataset.
Result:
High error and poor performance — appropriate as a baseline but insufficient for real prediction needs.
With engineered features, three models were trained:
| Model | MAE | RMSE | R² |
|---|---|---|---|
| Linear Regression (FE) | 14511 | 21592 | 0.106 |
| Gradient Boosting Regressor | 5899 | 10184 | 0.801 |
| Extra Trees Regressor (Winner) | 2707 | 6517 | 0.919 |
Insight:
Extra Trees delivered the best performance, effectively capturing nonlinear patterns and complex interactions.
The winning regression model (Extra Trees Regressor) was exported as:
extra_trees_winner.pkl
and uploaded to this repository.
Weekly Sales were converted into binary classes using a median split:
The resulting classes were balanced, enabling stable classification training.
The class distribution after converting Weekly Sales into a binary target is shown below:

Three models were trained:
| Model | Accuracy |
|---|---|
| Logistic Regression | 0.587 |
| Gradient Boosting Classifier | 0.862 |
| Random Forest Classifier (Winner) | 0.884 |
Business Insight (FN > FP):
False Negatives (predicting low sales when actual sales are high) are far more costly due to stockouts and lost revenue.