Skip to content

A machine learning-based crop recommendation system that predicts the most crop to cultivate based on environmental and soil parameters. This project compares multiple classification algorithms, including SVM, Random Forest, Decision Tree, KNN, Naive Bayes, Logistic Regression, and ANN, to determine the optimal model for accurate crop prediction.

License

Notifications You must be signed in to change notification settings

shahbajtahershezan/Crop-Recommendation-using-ML-Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒพ Crop Recommendation using Machine Learning

This project aims to build an intelligent system that recommends the most suitable crop to grow based on soil and climate parameters using various machine learning algorithms.


๐Ÿง  Project Overview

Agriculture is the backbone of many economies, and choosing the right crop based on environmental conditions is crucial for sustainable yield.
This project leverages supervised machine learning to predict the optimal crop using features like:

  • Nitrogen (N)
  • Phosphorus (P)
  • Potassium (K)
  • Temperature
  • Humidity
  • pH
  • Rainfall

๐Ÿงน Data Preprocessing

  1. Handled missing values and normalized the dataset.
  2. Applied StandardScaler for feature standardization.
  3. Used PCA (Principal Component Analysis) to reduce dimensionality and visualize data distribution.

โš™๏ธ Machine Learning Models

The following models were trained and compared:

Algorithm Description
SVM Support Vector Machine for non-linear classification
Decision Tree Simple and interpretable tree-based classifier
Random Forest Ensemble method combining multiple decision trees
Logistic Regression Linear model for baseline comparison
KNN Distance-based classification method
Naive Bayes Probabilistic approach based on Bayes' theorem
ANN Artificial Neural Network for deep learning-based classification

๐Ÿ“Š Model Evaluation

Each model was evaluated using:

  • Accuracy
  • Precision
  • Recall
  • F1-Score
  • Confusion Matrix

The Random Forest and ANN models achieved the best overall performance.


๐Ÿงช Technologies Used

  • Python
  • Jupyter Notebook
  • NumPy, Pandas, Matplotlib, Seaborn
  • Scikit-learn
  • TensorFlow / Keras (for ANN)

๐Ÿ“ Project Structure

About

A machine learning-based crop recommendation system that predicts the most crop to cultivate based on environmental and soil parameters. This project compares multiple classification algorithms, including SVM, Random Forest, Decision Tree, KNN, Naive Bayes, Logistic Regression, and ANN, to determine the optimal model for accurate crop prediction.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published