File size: 2,492 Bytes
4520b92
 
 
 
 
 
 
 
 
 
 
 
 
 
4127688
a84f203
4127688
 
 
fbc8294
 
 
 
 
 
 
4127688
 
 
 
 
 
 
 
fbc8294
4127688
fbc8294
4127688
fbc8294
4127688
 
fbc8294
 
4127688
fbc8294
 
 
 
 
 
 
 
 
 
 
4127688
fbc8294
 
 
 
4127688
fbc8294
4127688
fbc8294
4127688
fbc8294
 
4127688
fbc8294
4127688
 
 
 
 
fbc8294
4127688
fbc8294
4127688
fbc8294
4127688
 
 
 
fbc8294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4127688
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
title: SaleSight  ML model for sales forecasting
emoji: 📈
colorFrom: indigo
colorTo: green
sdk: gradio
sdk_version: "5.4.0"   # 👈 use the latest version
app_file: app.py
pinned: false
---




# Sales Forecasting with LightGBM

A retail sales prediction application built with LightGBM and Gradio for interactive forecasting.

## 📊 Demo

![Demo Screenshot](./demo/demo.png)

[Watch Demo Video](./demo/demo.mp4)

## ✨ Features

- Interactive web interface for sales prediction
- Takes into account various features including:
  - Promotional events
  - Holiday status
  - Historical sales data (various lags and rolling means)
  - Temporal features (day, month, year, day of week)
- Built with LightGBM for fast and accurate predictions
- Simple and intuitive user interface

## 🚀 Installation

1. Clone the repository:
   ```bash
   git clone https://github.com/yourusername/sales-forecasting.git
   cd sales-forecasting
   ```

2. Create and activate a virtual environment:
   ```bash
   # Create a virtual environment
   python -m venv .venv
   
   # Activate it
   # On Linux/Mac:
   source .venv/bin/activate
   # On Windows:
   .venv\Scripts\activate
   ```

3. Install the required dependencies:
   ```bash
   pip install -r requirements.txt
   ```

## 🛠️ Usage

1. Run the application:
   ```bash
   python app.py
   ```

2. Open your web browser and navigate to the URL shown in the terminal (typically http://localhost:7860)

3. Input the required information:
   - Promo status (0 or 1)
   - Holiday status (0 or 1)
   - Date in YYYY-MM-DD format
   - Sales lags and rolling means

4. Click "Predict Sales" to see the prediction

## 📦 Dependencies

- gradio >= 3.50.0
- joblib >= 1.3.0
- lightgbm >= 4.0.0
- pandas >= 2.0.0

## 🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🙏 Acknowledgements

- [LightGBM](https://github.com/microsoft/LightGBM) - The gradient boosting framework used for predictions
- [Gradio](https://gradio.app/) - For the simple web interface
- [Pandas](https://pandas.pydata.org/) - For data manipulation and analysis