The Crop Yield Prediction project aims to classify soil fertility based on various soil properties using machine learning models ๐ค. It categorizes soil into three classes:
- ๐ข 0 - Less Fertile
- ๐ก 1 - Fertile
- ๐ด 2 - Highly Fertile
We use key soil nutrients and properties like Nitrogen (N), Phosphorous (P), Potassium (K), pH level, Electrical Conductivity (ec), Organic Carbon (oc), and other micronutrients to predict soil fertility.
- ๐ฏ Tanishq Thuse
- ๐ฅ Kavish Paraswar
- โก Swaraj Patil
- ๐ Neel Sahastrabudhe
We used the Soil Fertility Dataset available on Kaggle ๐:
๐ Dataset Link
๐ Dataset Details:
โ
1288 samples
โ
12 input features
โ
1 target variable (Fertility Classification: 0, 1, 2)
๐ 1. Data Exploration - Understanding feature distributions and correlations
๐ 2. Data Preprocessing - Splitting data into training and validation sets
๐ง 3. Model Training - Implementing ML models:
- ๐ณ Random Forest Classifier
- ๐ฆ Gaussian Naive Bayes
- โก Support Vector Machine (SVM)
- ๐ K-Nearest Neighbors (KNN)
๐ 4. Model Evaluation - Analyzing accuracy & classification reports
๐ง 5. Data Modification - Improving model performance
| Feature | Description |
|---|---|
| N | Nitrogen (NH4+) ratio |
| P | Phosphorous ratio |
| K | Potassium ratio |
| pH | Soil acidity level |
| ec | Electrical Conductivity |
| oc | Organic Carbon |
| S | Sulfur content |
| Zn, Fe, Cu, Mn, B | Micronutrient levels |
| Output | Fertility Class (0, 1, 2) |
๐ Pandas - Data manipulation
โ NumPy - Numerical computations
๐ Matplotlib & Seaborn - Data visualization
๐ค Scikit-learn - Machine Learning models
git clone https://github.com/your-repo/crop-yield-prediction.git
cd crop-yield-predictionpip install -r requirements.txtjupyter notebook GFG_Project.ipynb๐ Sections:
โ
Data Exploration
โ
Data Preprocessing
โ
Model Training
โ
Model Evaluation
๐ฏ Random Forest Classifier achieved 94.95% accuracy! ๐ฏ
๐น Model performance can be improved further by:
- Hyperparameter tuning ๐
- Feature engineering ๐งช
๐ Feature Engineering - Add more soil properties for better predictions
๐ Hyperparameter Tuning - Use Grid Search / Random Search
๐ Deployment - Convert the model into a web app or API ๐
The Crop Yield Prediction project successfully uses Machine Learning in agriculture to optimize soil management and maximize crop yields ๐พ.
๐ฌ Future improvements can make it more accurate & scalable for real-world applications! ๐
This project is licensed under the MIT License ๐. See the LICENSE file for details.
โจ Team Rocket ๐
๐
Date: 31/01/2025