Skip to content

git-sharwaree/Crop-Prediction-and-Condition-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒฟ Crop Prediction and Condition Analysis

๐Ÿ“Œ Overview

This project aims to support precision farming by recommending the most suitable crop based on soil and environmental parameters. It also analyzes the ideal growing conditions for various crop varieties, offering data-driven insights for improved agricultural decision-making.


๐ŸŽฏ Objectives

  • ๐Ÿ” Predict the most appropriate crop based on given environmental and soil data.
  • ๐Ÿ“Š Analyze optimal growing conditions such as temperature, humidity, rainfall, and soil nutrients (N, P, K).
  • โš™๏ธ Compare two machine learning approaches to determine the most reliable and accurate solution.

๐Ÿ› ๏ธ Implementation

Two modeling approaches were explored:

1๏ธโƒฃ Multiclass Classification for Crop Recommendation

Trained a classification model using:

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

โœ… Achieved 96.8% accuracy using scikit-learn with proper model tuning.

2๏ธโƒฃ Reverse Modeling for Ideal Conditions

Built a model to predict the ideal environmental conditions required for a given crop.
While informative, this approach was less accurate than the crop classification model.

๐Ÿ“Œ Conclusion: The classification model performed significantly better for the task of crop prediction.


โš™๏ธ Tech Stack

  • Python
  • scikit-learn, pandas, NumPy
  • matplotlib, seaborn
  • Jupyter Notebook

๐ŸŒŸ Features

  • Predicts the best crop based on input environmental factors.
  • Visualizes how conditions affect crop suitability.
  • Compares and explains model performance.

๐Ÿš€ Future Improvements

  • ๐ŸŒฆ๏ธ Integrate with real-time weather and soil APIs.
  • ๐Ÿ“ Extend to include crop yield prediction.
  • ๐Ÿ–ฅ๏ธ Build a lightweight web interface for easier access.

About

A data-driven system to assist farmers in selecting the right crop for given conditions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published