This project is a Crop Recommendation System that helps farmers make informed decisions about which crops to cultivate based on soil and environmental conditions.
- Introduction
- Features
- Data Source
- Prerequisites
- Getting Started
- Usage
- Model Training
- Model Evaluation
- Predictive System
- Saving the Model
Agriculture is a vital sector for any country. The Crop Recommendation System aims to assist farmers in selecting the most suitable crops to plant based on soil quality and environmental factors. The system is built using machine learning techniques and allows farmers to input their soil and climate conditions to receive crop recommendations.
- Predicts suitable crops based on soil and climate data.
- Provides information about the best crop for a given set of conditions.
The dataset used for training and testing the model is available on Kaggle: Crop Recommendation Dataset
Before running the system, you'll need to install the required Python libraries. You can do this using pip:
-
Clone the repository:
git clone https://github.com/vikascod/crop-recommendation cd crop-recommendation
-
Install the project dependencies:
pip install -r requirements.txt
- Download the dataset from the provided Kaggle link and save it as Crop_recommendation.csv in the project directory.
- Open and run the Jupyter Notebook Crop_Recommendation.ipynb to train the model and explore the data.
- The Jupyter Notebook contains the code for data preprocessing, model training, and evaluation.
- The model is evaluated using accuracy and cross-validation scores. The best model is selected using GridSearchCV.
- The predictive system allows users to input their soil and climate data and receive crop recommendations.
- The trained model, StandardScaler, and LabelEncoder are saved to the crop_recommendation_model.pkl file. You can load this model for future predictions.