How vanivarun/crop-recommendation-system works
AgriSense is a Streamlit crop-recommendation app with Farmer and Expert input modes. Both lead to validation and Random Forest predictions; Farmer Mode can also use location-based weather. Results include ranked crops, confidence information, crop explanations, and model analytics. The repository also contains a separate training pipeline that reads the crop dataset and exports model artifacts. The app and prediction module overlap in artifact access. Some app behavior is documented in the README but not visible in the partial source excerpts, so uncertain internal links are omitted.
Main entry points: app.py Farmer / expert inputs · predict.py Validate and predict · weather.py Weather lookup · models Trained model artifacts
Components 15
User experience
- Farmer / expert inputs
app.py - Weather auto-fill
app.py - Ranked results
app.py - Crop explanation
app.py - Model analytics
app.py
Recommendation runtime
- Validate and predict
src/predict.py
Model lifecycle
- Trained model artifacts
models - Train and evaluate
src/train_model.py - Crop training data
data/crop_data.csv
External information
- Weather lookup
src/weather.py
Other components
- Farmer
- Agricultural expert
- Nominatim geocoding
- Open-Meteo weather
- Wikipedia summaries
Connections 14
- Farmer → Farmer / expert inputs: enters field details
- Agricultural expert → Farmer / expert inputs: enters lab values
- Farmer / expert inputs → Weather auto-fill: requests weather
- Weather auto-fill → Weather lookup: fetches location weather
- Weather lookup → Nominatim geocoding: geocodes location
- Weather lookup → Open-Meteo weather: fetches conditions
- Farmer / expert inputs → Validate and predict: submits field values
- Validate and predict → Trained model artifacts: loads model files
- Validate and predict → Ranked results: returns ranked crops
- Ranked results → Crop explanation: enriches top crop
- Crop explanation → Wikipedia summaries: requests crop summary
- Model analytics → Trained model artifacts: loads metrics and model
- Train and evaluate → Crop training data: reads samples
- Train and evaluate → Trained model artifacts: exports trained files