Skip to content

The Crop Yield Prediction project predicts soil fertility using machine learning based on soil properties and elemental analysis. It classifies soil into three categories: Less Fertile (0), Fertile (1), and Highly Fertile (2). The Random Forest Classifier achieved the best accuracy of 94.95%.

Notifications You must be signed in to change notification settings

TanishqThuse/Crop_Yield_Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒพ Crop Yield Prediction ๐ŸŒฑ

๐Ÿš€ Overview

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.

๐Ÿ‘จโ€๐Ÿ’ป Team Members

  • ๐ŸŽฏ Tanishq Thuse
  • ๐Ÿ”ฅ Kavish Paraswar
  • โšก Swaraj Patil
  • ๐Ÿš€ Neel Sahastrabudhe

๐Ÿ“Š Dataset

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)


๐Ÿ“‚ Project Structure

๐Ÿ” 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

๐Ÿ”‘ Features Used

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)

๐Ÿ“ฆ Libraries Used

๐Ÿ“Š Pandas - Data manipulation
โž• NumPy - Numerical computations
๐Ÿ“‰ Matplotlib & Seaborn - Data visualization
๐Ÿค– Scikit-learn - Machine Learning models


๐Ÿš€ How to Run the Project

1๏ธโƒฃ Clone the Repository

git clone https://github.com/your-repo/crop-yield-prediction.git
cd crop-yield-prediction

2๏ธโƒฃ Install Dependencies

pip install -r requirements.txt

3๏ธโƒฃ Run the Jupyter Notebook

jupyter notebook GFG_Project.ipynb

4๏ธโƒฃ Follow the Notebook Sections

๐Ÿ“Œ Sections:
โœ… Data Exploration
โœ… Data Preprocessing
โœ… Model Training
โœ… Model Evaluation


๐Ÿ† Results

๐ŸŽฏ Random Forest Classifier achieved 94.95% accuracy! ๐ŸŽฏ
๐Ÿ”น Model performance can be improved further by:

  • Hyperparameter tuning ๐Ÿ› 
  • Feature engineering ๐Ÿงช

๐Ÿ”ฎ Future Work

๐Ÿ“Œ 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 ๐ŸŒ


๐Ÿ Conclusion

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! ๐Ÿš€


๐Ÿ“œ License

This project is licensed under the MIT License ๐Ÿ“œ. See the LICENSE file for details.


โœจ Team Rocket ๐Ÿš€
๐Ÿ“… Date: 31/01/2025

About

The Crop Yield Prediction project predicts soil fertility using machine learning based on soil properties and elemental analysis. It classifies soil into three categories: Less Fertile (0), Fertile (1), and Highly Fertile (2). The Random Forest Classifier achieved the best accuracy of 94.95%.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published