Views
No views yet
Product_Store_Sales_Total for a retail chain operating supermarkets and food
marts across Tier 1-3 cities.| Metric | Value |
|---|---|
| RMSE | 277.28 |
| MAE | 107.66 |
| R² | 0.9326 |
| MAPE | 0.0391 |
1from huggingface_hub import hf_hub_download
2import joblib
3import pandas as pd
4
5# Download and load the pipeline
6model_path = hf_hub_download(
7 repo_id="jeremygracey-ai/superkart-sales-predictor",
8 filename="superkart_model.joblib"
9)
10model = joblib.load(model_path)
11
12# Prepare input -- all 10 features required
13sample = pd.DataFrame([{
14 "Product_Weight": 12.5,
15 "Product_Sugar_Content": "Low Sugar",
16 "Product_Allocated_Area": 0.05,
17 "Product_Type": "Dairy",
18 "Product_MRP": 150.0,
19 "Store_Size": "Medium",
20 "Store_Location_City_Type": "Tier 2",
21 "Store_Type": "Supermarket Type2",
22 "Product_Category": "Food",
23 "Store_Age": 0,
24}])
25
26prediction = model.predict(sample)[0]
27print(f"Predicted sales: ${prediction:,.2f}")Product_Store_Sales_Total
(continuous, range ~$33 - $8,000).Product_Category derived from Product_Id prefix (FD=Food,
NC=Non-Consumable, DR=Drinks)Store_Age derived from Store_Establishment_Year (reference: 2009)Product_Sugar_Content normalized (collapsed "reg" into "Regular", set
non-consumables to "No Sugar")Product_Id, Store_Id, Store_Establishment_Year dropped to prevent
identity leakage / enable generalization