Spaces:
Sleeping
title: Store Sales Forecasting
emoji: π
colorFrom: red
colorTo: red
sdk: docker
app_port: 8501
tags:
- streamlit
pinned: false
short_description: Streamlit template space
π Store Sales Forecasting
This application predicts daily retail sales using a machine learning model trained on the CorporaciΓ³n Favorita dataset. The goal is to estimate how much a specific store will sell for a selected product family on a given date while taking promotional activity into account.
The model learns hidden sales patterns from historical data, including store-specific behavior, seasonal effects, and product demand. By combining these signals, it can generate realistic sales forecasts in real time.
π How to Use
- Select the store number
- Choose a date
- Pick a product family
- Enter the number of items on promotion
- Click Predict Sales
The app will return the estimated daily sales.
π§ Model
The final model used in this project is XGBoost Regressor.
It was selected because it performs very well on structured tabular data, captures non-linear relationships, and handles one-hot encoded categorical features efficiently.
To improve stability and reduce the effect of extreme values, the model was trained on a log-transformed target:
sales β log1p(sales)
All predictions are automatically converted back to the original sales scale inside the app.
π Evaluation
Model performance is measured using RMSE (Root Mean Squared Error), which is the standard metric for regression and forecasting tasks because it penalizes large errors and is expressed in the same unit as the target variable.
β Key Insight
The most important driver of sales is the product family, followed by store behavior, promotional activity, and seasonal time features. This shows that demand is primarily determined by what is being sold, while time and promotions influence short-term fluctuations.
π§° Tech Stack
Scikit-learn
XGBoost
Pandas
NumPy
Streamlit
π¦ Files in This Space
- model.pkl β trained machine learning model
- features.pkl β feature order used during training
- X_test.npy / y_test.npy β evaluation data
- streamlit_app.py β application interface
π©βπ» Author
Beyza Topbas