Logo Lanfrica

amanpandey8120/mandi-prize

Domain:

agriculture

Record type:

softwaremodel
Creator:
ama
Host:
# 🌾 AgroAid Mandi Price Prediction API ## Overview The AgroAid Mandi Price Prediction API is a Machine Learning-powered service that predicts agricultural commodity prices using historical mandi market data. The API is designed to integrate with the AgroAid platform and provide: * Real-time price prediction * 7-day price forecasting * Market trend analysis * Confidence scoring * Sell/Hold recommendations The model is trained on historical APMC mandi data and deployed using FastAPI and Render. --- # Project Architecture ``` AgroAid App β”‚ β–Ό Supabase Database β”‚ β–Ό Feature Generation β”‚ β–Ό Mandi Prediction API β”‚ β–Ό LightGBM Model β”‚ β–Ό Prediction Results ``` --- # Technology Stack ### Backend * Python * FastAPI * Pandas * NumPy ### Machine Learning * LightGBM * Scikit-Learn * Joblib ### Database * Supabase PostgreSQL ### Deployment * Render --- # Project Structure ``` mandi-price-api/ β”‚ β”œβ”€β”€ main.py β”œβ”€β”€ requirements.txt β”œβ”€β”€ district_mapping.json β”œβ”€β”€ commodity_mapping.json β”œβ”€β”€ README.md β”‚ β”œβ”€β”€ mandi_price_model.pkl β”‚ └── training/ β”œβ”€β”€ train_model.ipynb β”œβ”€β”€ clean_apmc_data.csv └── feature_engineering.py ``` --- # File Descriptions ## main.py Main FastAPI application. Responsibilities: * Load trained model * Accept API requests * Generate predictions * Generate forecasts * Calculate trends * Calculate confidence scores * Generate recommendations Available endpoints: * GET / * POST /predict * POST /forecast * POST /trend * POST /confidence * POST /recommendation --- ## mandi_price_model.pkl Serialized LightGBM model. Generated after training. Used for: * Single day prediction * Forecast generation --- ## district_mapping.json District encoder mapping. Example: ```json { "Rewa": 47, "Bhopal": 12 } ``` Purpose: Convert district names into numerical values used by the model. --- ## commodity_mapping.json Commodity encoder mapping. Example: ```json { "Wheat": 58, "Soybean": 125 } ``` Purpose: Convert commodity names into numerical values …

Languages