This project predicts the most suitable crop to cultivate based on environmental conditions such as Nitrogen, Phosphorus, Potassium (NPK), temperature, humidity, pH, and rainfall using machine learning models.
Farmers often struggle to choose the right crop for cultivation based on soil health and climatic conditions. This system helps recommend the best-suited crop using data-driven decision-making.
- User-friendly UI using Streamlit
- Trained on a reliable agriculture dataset
- Supports real-time prediction
- Interactive and lightweight deployment
- Clean and modular Python code
- Python
- Pandas, NumPy, Matplotlib, Seaborn
- Scikit-learn (for training ML models)
- Streamlit (for building the web interface)
The dataset used includes the following features:
- N: Nitrogen content in soil
- P: Phosphorus content in soil
- K: Potassium content in soil
- Temperature (Β°C)
- Humidity (%)
- pH
- Rainfall (mm)
You can download the dataset from Kaggle - Crop Recommendation Dataset or use your custom dataset.
- Data preprocessing: cleaned and normalized.
- Model training: used algorithms like Random Forest, Decision Tree, and KNN.
- Model selection: best accuracy model chosen.
- Deployment: integrated into Streamlit for simple UI access.