--- title: Store Sales Forecasting emoji: πŸ›’ colorFrom: blue colorTo: green sdk: streamlit sdk_version: 1.31.0 python_version: '3.10' app_file: app.py pinned: false license: mit --- # Store Sales Time-Series Forecasting ## πŸ“Œ Project Overview This project is a time-series forecasting application designed to predict grocery store sales for CorporaciΓ³n Favorita, a large Ecuadorian retailer. The model is built to help retailers optimize inventory levels by understanding how external factors like oil prices, holidays, and economic shocks impact consumer behavior. ## πŸš€ Technical Implementation - **Model:** Linear Regression (Baseline) - **Environment:** Python 3.10 - **Framework:** Streamlit - **Deployment:** Hugging Face Spaces ## πŸ› οΈ Feature Engineering & Insights To improve model accuracy, I integrated several data sources and engineered specific features: - **Relational Merges:** Combined sales data with oil prices, store metadata, and holiday schedules. - **Payday Impact:** Created a binary feature for the 15th and last day of each month to capture spending spikes. - **Seismic Events:** Accounted for the significant impact of the 2016 earthquake on local consumption patterns. - **Categorical Encoding:** Transformed product families and holiday types into numeric formats for machine learning compatibility. ## πŸ“Š Key Findings - **Promotions:** Proved to be the strongest driver of sales volume. - **Regional Context:** External events (like the 2016 earthquake) created measurable shifts in demand that standard time-series models might otherwise miss. - **Oil Correlation:** Captured the subtle inverse relationship between crude oil prices and local retail activity in Ecuador. ## πŸ“ Repository Structure - `app.py`: Streamlit application interface. - `linear_regression_model.pkl`: Serialized model weights. - `model_features.pkl`: Saved feature order for consistent inference. - `requirements.txt`: Project dependencies for Python 3.10. ## πŸ“ How to Use 1. Select a target date from the sidebar. 2. Input store details and promotion status. 3. Adjust the oil price or holiday context. 4. Click **Predict** to see the estimated sales units.