How srividyadasari5/opti-crop works
OptiCrop is a Flask web application that recommends a crop from seven soil and weather inputs. A user enters measurements in the browser; the frontend submits them to Flask, which validates and scales them before predicting with a trained classifier and returning a crop recommendation. The training pipeline prepares the CSV dataset, compares classifiers, and saves the winning model and scaler. The README also describes model benchmarking and clustering. Source excerpts show the web and training code; other documented capabilities are retained where their implementation was not sampled.
Main entry points: app.py Flask routes · train.py Training and comparison · script.js Form interaction · index.html Input form
Components 12
Farmer interface
- Input form
5. Project Development Phase/templates/index.html - Form interaction
5. Project Development Phase/static/script.js - Interface styles
5. Project Development Phase/static/style.css - Crop recommendation
5. Project Development Phase/static/script.js
Prediction service
- Flask routes
5. Project Development Phase/app.py - Input validation
5. Project Development Phase/app.py
Model pipeline
- Feature scaling
5. Project Development Phase/app.py - Crop classifier
5. Project Development Phase/app.py - Training and comparison
5. Project Development Phase/train.py - K-Means analysis
5. Project Development Phase/train.py
Agricultural data
- Crop dataset
5. Project Development Phase/data/Crop_recommendation.csv
Other components
- Farmer
Connections 12
- Farmer → Input form: enters measurements
README.md - Input form → Form interaction: submits form
5. Project Development Phase/static/script.js - Form interaction → Flask routes: POSTs inputs
5. Project Development Phase/static/script.js - Flask routes → Input validation: validates inputs
5. Project Development Phase/app.py - Flask routes → Feature scaling: scales features
5. Project Development Phase/app.py - Flask routes → Crop classifier: predicts crop
5. Project Development Phase/app.py - Flask routes → Input form: renders page
5. Project Development Phase/app.py - Form interaction → Crop recommendation: displays response
5. Project Development Phase/static/script.js - Training and comparison → Crop dataset: reads data
5. Project Development Phase/train.py - Training and comparison → K-Means analysis: fits clusters
5. Project Development Phase/train.py - Training and comparison → Crop classifier: selects and saves model
5. Project Development Phase/train.py - Training and comparison → Feature scaling: saves scaler
5. Project Development Phase/train.py