Conversation
|
@Aditya8369 is attempting to deploy a commit to the Om Roy's projects Team on Vercel. A member of the Team first needs to authorize it. |
Thanks for creating a PR for your Issue!
|
Contributor
Author
|
🎉 Congrats @Aditya8369 on getting your PR merged! 🙌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #1884
Key Components Implemented
backend/ml_models/price_forecast.py
)
Data Ingestion & Historical Series:
Ingests and simulates daily commodity pricing from Agmarknet & e-NAM across 15+ major Indian mandis (Azadpur, Vashi, Lasalgaon, Khanna, Guntur, Kolar, Surat, Rajkot, Indore, Jaipur, etc.) for 12+ core commodities (Tomato, Onion, Wheat, Rice, Cotton, Soybean, Potato, Maize, Mustard, Gram, Turmeric, Garlic).
Time-Series Forecasting (ARIMA / Prophet / XGBoost Principles):
Generates 7- to 14-day daily price projections.
Decomposes weekly demand cycles (Monday arrival surges, weekend adjustments) and seasonal harvesting patterns.
Computes 95% Confidence Intervals (yhat, yhat_lower, yhat_upper).
Identifies the Optimal Selling Day with expected percentage gains and outputs actionable recommendations (e.g., HOLD CROP, SELL NOW, STABLE).
2. Logistics & Net-Profit Optimizer (
backend/services/mandi_profit_optimizer.py
)
Distance Matrix & Freight Calculator:
Computes exact road distances from the farmer's GPS/district to all regional mandis using OpenStreetMap / Haversine road tortuosity calculations.
Supports 4 vehicle fleet profiles:
Pickup Truck (1.5T / ₹16/km)
Tractor Trolley (4.5T / ₹24/km)
Eicher Mini Truck (8.5T / ₹34/km)
Heavy Commercial Truck (22T / ₹54/km)
Net Realization Accounting:
Gross Revenue = Volume (Quintals) × Mandi Price (₹/Quintal)
Logistics Cost = Road Freight + Loading/Unloading Labor + APMC Mandi Cess (1.5%) + Tolls
Net Farmgate Profit = Gross Revenue - Total Logistics Cost
Arbitrage Opportunity Detection: Identifies whether traveling to a higher-paying distant mandi yields net-positive profits after deducting transport fuel and labor.
GeoJSON Price Heatmap: Generates normalized heat weights for Leaflet.js rendering.
3. Database Models & REST API (
backend/api/v1/market.py
&
backend/models/market.py
)
POST /api/v1/market/forecast – 7- to 14-day price forecasting with 95% confidence intervals.
POST /api/v1/market/optimize-profit – Computes nearby mandis, road logistics, and net profit ranking.
GET /api/v1/market/heatmap – GeoJSON FeatureCollection for Leaflet price heatmaps.