This project focuses on predicting the most suitable crop to grow based on environmental factors such as nitrogen levels, phosphorus levels, potassium levels, temperature, humidity, rainfall, and pH. The prediction model is deployed as a web application using Flask for the backend and HTML/CSS for the frontend.
The dataset used in this project includes records of nitrogen, phosphorus, potassium levels, temperature, humidity, rainfall, pH, and corresponding crop types. The dataset is preprocessed and analyzed in Jupyter Notebook to train the predictive model.
In the Jupyter Notebook phase of the project, the focus was on preparing the dataset for predictive modeling. Using Python libraries like Pandas and NumPy, the data underwent rigorous cleaning, ensuring consistency and accuracy. Preprocessing steps included handling missing values, removing duplicates, and addressing outliers. Additionally, exploratory data analysis (EDA) was conducted to gain insights into the relationships between environmental factors and crop types. This phase also involved feature engineering to extract relevant information from the dataset, followed by the training and evaluation of machine learning models such as decision trees and random forests. Through iterative experimentation and validation, the models were refined to achieve optimal performance in predicting crop recommendations.
Moving on to web application development, Flask was employed to construct the backend server responsible for communicating with the trained model. API endpoints were meticulously defined to handle incoming requests from the frontend, enabling seamless interaction between the user interface and the predictive model. On the frontend side, HTML templates and CSS stylesheets were utilized to craft an intuitive and visually appealing user interface. The frontend interface provided users with a platform to input environmental factors of interest, initiating the prediction process. Through the integration of Flask backend and HTML/CSS frontend components, the Crop Prediction Web Application was brought to life, offering users a convenient and efficient tool for making informed decisions regarding crop selection based on environmental conditions.