Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
---
|
| 2 |
title: TimeSeriesForecasting
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
app_port: 8501
|
| 8 |
tags:
|
|
@@ -12,9 +12,33 @@ short_description: LightGBM-based time series forecasting app that predicts...
|
|
| 12 |
license: mit
|
| 13 |
---
|
| 14 |
|
| 15 |
-
#
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: TimeSeriesForecasting
|
| 3 |
+
emoji: ๐
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
sdk: docker
|
| 7 |
app_port: 8501
|
| 8 |
tags:
|
|
|
|
| 12 |
license: mit
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# ๐ Sales Forecast (LightGBM)
|
| 16 |
|
| 17 |
+
This Streamlit app predicts **`num_sold`** using a trained **LightGBM** model with time-based features and lag features.
|
| 18 |
|
| 19 |
+
## What it does
|
| 20 |
+
- Takes calendar features (year/month/week/dayofweek/dayofyear, weekend)
|
| 21 |
+
- Uses lag features (lag_364, lag_365, lag_371)
|
| 22 |
+
- Uses categorical inputs (country/store/product) via saved encoders
|
| 23 |
+
- Outputs a `num_sold` prediction
|
| 24 |
+
|
| 25 |
+
## Files required (put in the repo root)
|
| 26 |
+
- `app.py`
|
| 27 |
+
- `lgbm_model.pkl`
|
| 28 |
+
- `feature_names.pkl` (list of feature names in correct order)
|
| 29 |
+
- `encoders.pkl` (dict of LabelEncoders for `country`, `store`, `product`)
|
| 30 |
+
- `fill_map.pkl` (optional: medians for numeric feature filling)
|
| 31 |
+
|
| 32 |
+
## How to save artifacts in your notebook (training side)
|
| 33 |
+
|
| 34 |
+
```python
|
| 35 |
+
import joblib
|
| 36 |
+
|
| 37 |
+
joblib.dump(model_lgb, 'lgbm_model.pkl')
|
| 38 |
+
joblib.dump(FEATURES, 'feature_names.pkl')
|
| 39 |
+
joblib.dump(encoders, 'encoders.pkl')
|
| 40 |
+
|
| 41 |
+
# optional numeric medians for filling missing
|
| 42 |
+
num_cols = [c for c in FEATURES if c not in ['country', 'store', 'product']]
|
| 43 |
+
fill_map = train_fe[num_cols].median().to_dict()
|
| 44 |
+
joblib.dump(fill_map, 'fill_map.pkl')
|