Upload folder using huggingface_hub
Browse files- README.md +70 -0
- best_model.pkl +3 -0
- label_encoders.pkl +3 -0
README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- sales-forecasting
|
| 5 |
+
- random-forest
|
| 6 |
+
- regression
|
| 7 |
+
- superkart
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# SuperKart Sales Forecasting Model
|
| 11 |
+
|
| 12 |
+
This is a Random Forest Regressor model trained to predict product sales at SuperKart stores.
|
| 13 |
+
|
| 14 |
+
## Model Details
|
| 15 |
+
|
| 16 |
+
- **Model Type:** Random Forest Regressor
|
| 17 |
+
- **Task:** Regression (Sales Forecasting)
|
| 18 |
+
- **Training Data:** SuperKart historical sales data (8,763 records)
|
| 19 |
+
- **Test R² Score:** 0.9319
|
| 20 |
+
- **Test RMSE:** $278.68
|
| 21 |
+
|
| 22 |
+
## Best Hyperparameters
|
| 23 |
+
|
| 24 |
+
- n_estimators: 200
|
| 25 |
+
- max_depth: None
|
| 26 |
+
- min_samples_split: 5
|
| 27 |
+
- min_samples_leaf: 2
|
| 28 |
+
|
| 29 |
+
## Features
|
| 30 |
+
|
| 31 |
+
The model uses the following features:
|
| 32 |
+
- Product_Weight
|
| 33 |
+
- Product_Sugar_Content
|
| 34 |
+
- Product_Allocated_Area
|
| 35 |
+
- Product_Type
|
| 36 |
+
- Product_MRP
|
| 37 |
+
- Store_Size
|
| 38 |
+
- Store_Location_City_Type
|
| 39 |
+
- Store_Type
|
| 40 |
+
- Store_Age
|
| 41 |
+
- Price_Category
|
| 42 |
+
|
| 43 |
+
## Usage
|
| 44 |
+
```python
|
| 45 |
+
import joblib
|
| 46 |
+
import pandas as pd
|
| 47 |
+
|
| 48 |
+
# Load model
|
| 49 |
+
model = joblib.load('best_model.pkl')
|
| 50 |
+
|
| 51 |
+
# Load label encoders
|
| 52 |
+
label_encoders = joblib.load('label_encoders.pkl')
|
| 53 |
+
|
| 54 |
+
# Make predictions
|
| 55 |
+
predictions = model.predict(X_test)
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## Performance Comparison
|
| 59 |
+
|
| 60 |
+
| Model | Test R² Score | Test RMSE |
|
| 61 |
+
|-------|--------------|-----------|
|
| 62 |
+
| Random Forest | 0.9319 | $278.68 |
|
| 63 |
+
| XGBoost | 0.9314 | $279.69 |
|
| 64 |
+
| Gradient Boosting | 0.9290 | $284.58 |
|
| 65 |
+
|
| 66 |
+
## Training Details
|
| 67 |
+
|
| 68 |
+
- Train-Test Split: 80-20
|
| 69 |
+
- Cross-Validation: 3-fold
|
| 70 |
+
- Evaluation Metrics: RMSE, MAE, R²
|
best_model.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2db5fa1644e53a5adaca80453e7a0fb6e18ece85e96ebae08f9a06083208aff
|
| 3 |
+
size 45374065
|
label_encoders.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8dd421356aedf74f126efd3e67e7348a85670ed777bba75d769aeccc6e763141
|
| 3 |
+
size 991
|