Views
No views yet
Hybrid Prophet + ARIMA ensemble for forecasting Indian wholesale apple prices (₹/kg) and generating SELL / STORE recommendations for farmers and traders.
| Component | Details |
|---|---|
| Architecture | Hybrid Prophet + ARIMA Ensemble |
| Blend Weights | 60% Prophet + 40% ARIMA |
| Currency | INR (₹) — wholesale price per kg |
| Training Data | 12,000 synthetic samples (2018–2021) |
| Varieties | Shimla, Kinnauri, Royal Delicious, Golden Delicious, Maharaji |
| Regions | Himachal Pradesh, Jammu & Kashmir, Uttarakhand, Arunachal Pradesh, Nagaland |
1from model.predict import predict_price
2
3result = predict_price({
4 "date": "2026-03-07",
5 "current_price": 120.0, # ₹/kg (current wholesale price)
6 "storage_time_days": 15,
7 "apple_variety": "Kinnauri",
8 "region": "Himachal Pradesh",
9})
10
11print(result)
12# {
13# "predicted_price_7d": 127.50,
14# "recommendation": "STORE",
15# "current_price": 120.0,
16# "storage_cost_7d": 5.25,
17# "breakeven_price": 125.25,
18# "currency": "INR",
19# "confidence": "hybrid Prophet+ARIMA (0.6/0.4)"
20# }apple-price-predictor/
├── data/
│ └── apple_price_dataset.csv # 12,000-sample Indian market dataset
├── models/
│ ├── prophet_model.pkl # Trained Prophet model
│ ├── arima_model.pkl # Trained ARIMA model
│ ├── scaler.pkl # MinMaxScaler for feature normalization
│ └── metrics.json # MAE / RMSE evaluation metrics (in ₹)
├── model/
│ └── predict.py # Inference wrapper
├── train.py # Full training pipeline
├── requirements.txt
└── README.md| Column | Description |
|---|---|
date | Daily timestamps (2018-01-01 onward) |
apple_variety | Shimla / Kinnauri / Royal Delicious / Golden Delicious / Maharaji |
region | HP / J&K / Uttarakhand / Arunachal Pradesh / Nagaland |
harvest_season | 1 if July–October (Indian harvest window) |
storage_time_days | Days in cold storage post-harvest |
temperature | Daily temperature °C (hill station climate) |
rainfall | Daily rainfall mm (monsoon-shaped curve) |
market_demand_index | Demand pressure (peaks: summer stock-out + Diwali) |
supply_index | Supply pressure (high during harvest, monsoon shocks) |
previous_week_price | Wholesale price 7 days prior (₹/kg) |
price | Target — wholesale market price (₹/kg) |
| Driver | Effect |
|---|---|
| Harvest season (Jul–Oct) | −₹12/kg discount (fresh supply glut) |
| Summer scarcity (Apr–Jun) | +₹15/kg spike (low cold-storage stock) |
| Festival demand (Diwali) | +₹5–₹15/kg premium |
| Monsoon road blockage | +₹0–₹10/kg in HP/JK (supply shock) |
| Cold-storage decay | −₹0.08/kg/day (quality degradation) |
| Inflation trend | +₹5/kg per year |
| Market noise | ±₹4/kg random volatility |
| Feature | Description |
|---|---|
month | Calendar month (1–12) |
week_of_year | ISO week (1–53) |
season | winter / pre_monsoon / monsoon / post_monsoon |
storage_cost_estimate | ₹0.75 × storage_time_days |
price_trend | Day-over-day price change (₹) |
rolling_mean_price | 7-day rolling mean (₹) |
rolling_std_price | 7-day rolling std dev (₹) |
pmdarimafinal_prediction = (0.6 × prophet_prediction) + (0.4 × arima_prediction)storage_cost_7d = ₹0.75 × 7 = ₹5.25/kg
breakeven_price = current_price + storage_cost_7d
if predicted_price_7d > breakeven_price:
recommendation = "STORE"
else:
recommendation = "SELL"1pip install -r requirements.txt
2python train.py| Model | MAE (₹/kg) | RMSE (₹/kg) |
|---|---|---|
| Prophet | ~₹15–20 | ~₹18–25 |
| ARIMA | ~₹5–8 | ~₹7–12 |
| Hybrid | ~₹10–14 | ~₹14–18 |
models/metrics.json)