Downloads · 30 days
0
Arko007/apple-price-predictor
apple-price-predictor is a machine learning model from Arko007. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Hybrid Prophet + ARIMA ensemble for forecasting Indian wholesale apple prices (₹/kg) and generating SELL / STORE recommendations for farmers and traders.
Downloads · 30 days
0
Access
Public
Updated Mar 7, 2026
Repo size
135 MB
Likes
0
Public
Click a slice to open those files.
.pkl56 MB · 98%
From the Hugging Face model README
Hybrid Prophet + ARIMA ensemble for forecasting Indian wholesale apple prices (₹/kg) and generating SELL / STORE recommendations for farmers and traders.
This model forecasts apple mandi/wholesale prices 7 days ahead and recommends whether farmers or cold-storage traders should SELL immediately or STORE for better returns, accounting for Indian cold-storage costs (₹0.75/kg/day).
| 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 |
from model.predict import predict_price
result = predict_price({
"date": "2026-03-07",
"current_price": 120.0, # ₹/kg (current wholesale price)
"storage_time_days": 15,
"apple_variety": "Kinnauri",
"region": "Himachal Pradesh",
})
print(result)
# {
# "predicted_price_7d": 127.50,
# "recommendation": "STORE",
# "current_price": 120.0,
# "storage_cost_7d": 5.25,
# "breakeven_price": 125.25,
# "currency": "INR",
# "confidence": "hybrid Prophet+ARIMA (0.6/0.4)"
# }
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
Synthetic dataset simulating realistic Indian apple market dynamics:
| 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 |
Typical wholesale price range: ₹40 – ₹165/kg
| 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"
pip install -r requirements.txt
python train.py
| Model | MAE (₹/kg) | RMSE (₹/kg) |
|---|---|---|
| Prophet | ~₹15–20 | ~₹18–25 |
| ARIMA | ~₹5–8 | ~₹7–12 |
| Hybrid | ~₹10–14 | ~₹14–18 |
(Exact values saved in models/metrics.json)
MIT License — free for research and commercial use.