Machine Learning based Crop Recommendation System using Random Forest and ANN.
# 🌱 Krishi Sahayak — AI-Powered Crop Advisory System
A multi-modal agricultural advisory platform that helps a farmer decide **what to grow** and **how to grow it** — combining a trained machine learning model, real historical government crop-production data, and a multilingual crop-care reference guide, all through an interactive Streamlit app.
This isn't a single-model demo. It's three distinct systems, each answering the same "what should I grow" question with a different, deliberately-chosen mechanism — and each one exists because the previous approach was tested, found lacking for a specific real reason, and replaced rather than patched over.
---
## 📌 Why Three Modes, Not One
| Mode | Mechanism | Best for |
|---|---|---|
| 🌾 **Parameter-Based** | Trained ML model (Random Forest) on soil + climate | When you have real soil test values (N, P, K, pH) and climate readings |
| 🌍 **State-Based** | Real historical government crop-production statistics, ranked by district + season | When you don't have soil data, but want to know what's actually, historically been grown in your district |
| 🌱 **Crop Care Guide** | Dataset-derived N/P/K/temperature requirements + fertilizer guidance + farming process, in 12 Indian languages | Once you've picked a crop, and need to know how to actually grow it |
---
## 🚀 Features
### 🌾 Parameter-Based Mode
- Enter N, P, K, temperature, humidity, pH, and rainfall directly
- Random Forest model (99.31% test accuracy) predicts the best-fit crop
- Shows prediction confidence
### 🌍 State-Based Mode
- Select Country → State → District → Season (Kharif/Rabi)
- Ranks the top 3 crops by their real historical share of recorded production/area for that district and season, sourced from government crop statistics
- Does **not** use the ML model — this is a statistics lookup against real records, not a prediction
### 🌱 Crop Care Guide
- Pick any of the 22 crops in the dataset
- See the crop's real average required N, P, K, and temperature …