0% found this document useful (0 votes)
7 views13 pages

Sample Template File For Project

The document outlines a project aimed at developing a machine learning-based recommendation system for crops and fertilizers to improve agricultural productivity. It details the methodology, tools, and technologies used, including data preprocessing, visualization, and model training with a Decision Tree Classifier, achieving 98.4% accuracy. The project addresses challenges faced by farmers in crop selection and resource optimization, providing data-driven insights for better decision-making.

Uploaded by

petkarprem711
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views13 pages

Sample Template File For Project

The document outlines a project aimed at developing a machine learning-based recommendation system for crops and fertilizers to improve agricultural productivity. It details the methodology, tools, and technologies used, including data preprocessing, visualization, and model training with a Decision Tree Classifier, achieving 98.4% accuracy. The project addresses challenges faced by farmers in crop selection and resource optimization, providing data-driven insights for better decision-making.

Uploaded by

petkarprem711
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Crop and Fertilizer

Recommendation System using


Machine Learning
- Prepared by Premprasad Dattatray Petkar
Learning Objectives

The main goal of this project is to create a machine learning-based


recommendation system for crops and fertilizers to enhance
agricultural productivity. This system utilizes data-driven insights to
help farmers make informed decisions regarding crop selection and
fertilizer application.

By undertaking this project, the following learning outcomes are


achieved: GOAL
• Mastering Machine Learning Techniques
• Data Analysis and Preprocessing
• Model Training and Optimization
• Practical Application of Python Libraries
• Interpreting Model Outputs
• Problem-Solving and Analytical Thinking
• Documentation and Reporting
Source : www.freepik.com/
Tools and Technology used

Programming Language:
Python: The primary programming language used for building the recommendation system due to its
simplicity and extensive library support.

Libraries:
 NumPy: A library for numerical computations, used for handling arrays and performing mathematical
operations efficiently.
 Pandas: A data manipulation library, used for loading, cleaning, and preprocessing the dataset.
 Matplotlib and Seaborn: Libraries for data visualization, used to create plots and graphs that help in
understanding the data distribution and relationships between features.
 Scikit-learn: A machine learning library, used for implementing the Decision Tree Classifier, data
preprocessing (scaling), and model evaluation.

Tools: Jupyter Notebook, VS Code.

Version Control: Git


Methodology

1. Data Collection:
• Used Crop_recommendation.csv containing features such as Nitrogen (N), Phosphorus (P),
Potassium (K), temperature, humidity, pH, and rainfall.
2. Data Preprocessing:
•Checked for missing and duplicate values.
•Performed feature scaling.
3. Data Visualization:
•Histograms for feature distributions.
•Scatter plots to analyze relationships between features and crop type.
•Correlation heatmap for feature relationships.
•Box plots to detect outliers.
4. Model Training:
•Implemented a Decision Tree Classifier.
•Split data into training and testing sets.
•Achieved 98.4% accuracy.
Problem Statement:
Farmers often face challenges in selecting the appropriate crops and fertilizers, leading to inefficient
resource usage and lower yields. These challenges arise from:

1. Lack of Data-Driven Insights: Traditional farming methods rely on intuition and experience rather than
data, making it difficult to optimize crop and fertilizer choices.
2. Environmental Variability: Soil quality, weather conditions, and other environmental factors vary
widely, complicating decision-making.
3. Resource Optimization: Efficient use of resources like water, fertilizers, and land is crucial for
sustainable farming but often difficult to achieve without proper guidance.
4. Yield Maximization: Farmers need reliable recommendations to maximize crop yields and ensure food
security.

This project aims to address these challenges by developing a machine


learning-based recommendation system that provides accurate, data-driven
recommendations for crop and fertilizer selection, ultimately improving
agricultural productivity and sustainability.
.
Solution:
1. Readymade Dataset:
•The project utilizes a pre-existing dataset (Crop_recommendation.csv) containing essential features such as
Nitrogen (N), Phosphorus (P), Potassium (K), temperature, humidity, pH, and rainfall. The target variable is
the type of crop.

2. Data Preprocessing:
•Missing and Duplicate Values: Checked for missing values and duplicates to ensure data integrity.
•Feature Scaling: Applied standard scaling to normalize the features, improving model performance.
•Encoding: Encoded the categorical target variable (crop type) into numerical values for machine learning
compatibility.

3. Data Visualization:
•Histograms: Visualized the distribution of each feature (N, P, K, temperature, humidity, pH, rainfall) using
histograms to understand data spread and central tendencies.
•Scatter Plots: Analyzed relationships between features and crop type using scatter plots to identify patterns
and correlations.
•Correlation Heatmap: Created a heatmap to visualize the correlation between different features, helping to
understand significant relationships.
•Box Plots: Used box plots to detect and visualize outliers in the dataset.
4. Model Training:
•Decision Tree Classifier: Implemented a Decision Tree Classifier to predict crop recommendations. The
model was trained using the preprocessed data.
•Model Evaluation: Evaluated the model's performance using a test set, achieving an accuracy score of
98.4%.

5. Model Deployment:
•Developed a function to predict the best crop based on input features (N, P, K, temperature, humidity, pH,
rainfall).
•Created a simple user interface using Python to allow users to input data and receive crop recommendations.

6. Result Interpretation and Visualization:


•Visualized and interpreted the model's predictions using various plots and charts, making the outputs
accessible and understandable for end-users.
•Provided clear and concise recommendations for crop and fertilizer selection based on the model's
predictions.
Screenshot of Output:
1) Histogram
Output:
Conclusion:

The machine learning-based crop and fertilizer recommendation system effectively addresses the
challenges faced by farmers in selecting appropriate crops and fertilizers. By leveraging a pre-existing
dataset and employing various data preprocessing, visualization, and machine learning techniques, the
project achieved a high accuracy of 98.4% using a Decision Tree Classifier.
Key Takeaways:
• Accurate Recommendations: Provides reliable suggestions based on essential soil and weather
parameters.
• Data Insights: Visualizations like histograms, scatter plots, and correlation heatmaps offered valuable
insights.
• Efficient Data Processing: Preprocessing steps ensured data quality and suitability for model training.
• Model Performance: The Decision Tree Classifier proved effective in making accurate predictions.

Future Directions:
• Real-Time Integration: Incorporate real-time weather updates for enhanced accuracy.
• Dataset Expansion: Add more diverse crops and features for improved model robustness.
• User Interface Development: Create a user-friendly interface for practical use by farmers.
Thank
you

You might also like