The Smart Agriculture Advisory System is an application designed to provide farmers with personalized advice on crop management, pest control, and irrigation scheduling. By leveraging machine learning models, the system analyzes various environmental and soil parameters to recommend the most suitable crops for cultivation.
The dataset used for this project is sourced from Kaggle: Crop Recommendation Dataset.
- N (Nitrogen): Nitrogen content in the soil
- P (Phosphorus): Phosphorus content in the soil
- K (Potassium): Potassium content in the soil
- temperature: Temperature in degree Celsius
- humidity: Relative humidity in %
- ph: pH value of the soil
- rainfall: Rainfall in mm
- label: Type of crop to be grown
- Anaconda: A distribution of Python and R for scientific computing and data science.
-
Install Anaconda
Download and install Anaconda from the official website based on your operating system.
-
Clone the Repository
git clone https://github.com/your-username/smart-agriculture-advisory-system.git cd smart-agriculture-advisory-system
-
Create a Conda Environment
conda create --name smart-agriculture python=3.8 conda activate smart-agriculture
-
Install Required Libraries
pip install -r requirements.txt
-
Install Jupyter Notebook
conda install -c conda-forge notebook
-
Run Jupyter Notebook
jupyter notebook
-
Open the Notebook
In the Jupyter Notebook interface, open
notebooks/Smart_Agriculture_Advisory_System.ipynb
to explore the analysis, model training, and predictions.
data/
: Contains the dataset used for training and testing.notebooks/
: Jupyter notebooks for data analysis and model building.models/
: Saved machine learning models.scripts/
: Python scripts for data processing and model training.requirements.txt
: List of required Python libraries.
Several machine learning models were evaluated for this multi-class classification problem. The final model chosen for deployment is a Random Forest classifier due to its high accuracy and robustness.
The model was trained using the following steps:
- Data Preprocessing: Handling missing values, scaling features, and encoding categorical variables.
- Feature Selection: Identifying the most important features contributing to the prediction.
- Model Training: Training the Random Forest classifier with hyperparameter tuning using GridSearchCV.
The model's performance was evaluated using accuracy, precision, recall, and F1-score. Cross-validation was also performed to ensure the model's robustness.
Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.