How boyasaikiran/crop_recommendation_system works
This is a Streamlit crop-recommendation application backed by a previously trained Random Forest model. The workflow runs from user-entered soil and weather conditions, through NPK feature calculation and scaling, to crop prediction and display. A separate training script prepares the CSV data, fits and evaluates the model, then saves the model and scaler used by the app. The README documents these capabilities; the training and app source excerpts show the principal calls and data transfers. The empty main.py and image contents provide no additional runtime behavior to map.
Main entry points: crop_recommendation.py Fit scaler · app.py Scale input · crop_recommendation_model.pkl Trained model · scaler.pkl Fitted scaler
Components 15
Training pipeline
- Data preparation
crop_recommendation.py - Feature engineering
crop_recommendation.py - Fit scaler
crop_recommendation.py - Train classifier
crop_recommendation.py - Model evaluation
crop_recommendation.py
Recommendation app
- Condition inputs
app.py - NPK feature build
app.py - Scale input
app.py - Crop prediction
app.py - Recommendation display
app.py
Data and assets
- Crop dataset
Crop_recommendation.csv - Trained model
crop_recommendation_model.pkl - Fitted scaler
scaler.pkl - Crop images
images
Other components
- Grower
Connections 15
- Grower → Condition inputs: enters conditions
app.py - Condition inputs → NPK feature build: provides values
app.py - NPK feature build → Scale input: passes features
app.py - Fitted scaler → Scale input: transforms with
app.py - Scale input → Crop prediction: passes scaled input
app.py - Trained model → Crop prediction: predicts with
app.py - Crop prediction → Recommendation display: displays result
app.py - Recommendation display → Crop images: loads matching image
app.py - Crop dataset → Data preparation: loads data
crop_recommendation.py - Data preparation → Feature engineering: engineers features
crop_recommendation.py - Feature engineering → Fit scaler: fits on features
crop_recommendation.py - Fit scaler → Train classifier: scales data
crop_recommendation.py - Train classifier → Model evaluation: evaluates predictions
crop_recommendation.py - Train classifier → Trained model: saves model
crop_recommendation.py - Fit scaler → Fitted scaler: saves scaler
crop_recommendation.py