Chat Bot for Crop Yield Prediction and Recommendation Through K-Nearest Neighbor Algorithm
摘要
The agricultural sector is vital to the nation’s economy, providing food, employment, income, foreign exchange, and raw materials for manufacturing industries. However, farmers face significant challenges in maintaining quality and quantity controls over crop cultivation to meet market demands, requiring extensive knowledge and expertise. In India, a leading producer of various crops, the agricultural sector still suffers from insufficient yields due to the lack of advanced techniques and a reliable referral system for farmers. A critical gap exists in the decision-making process for Indian farmers, who struggle with selecting appropriate crops based on soil characteristics and assessing soil health. This issue has significantly impacted their productivity. Addressing this gap is essential for optimizing resource allocation and mitigating future risks. Accurate crop yield prediction and crop recommendation are crucial in agricultural decision-making, and recent advancements in machine learning algorithms have facilitated more precise predictions. This study focuses on employing the Decision Tree method for crop yield prediction. Once constructed, the Decision Tree model can predict crop yields for unknown data and be updated with new inputs such as soil measurements or weather forecasts. The interpretability of Decision Trees allows farmers to identify the factors that most significantly affect crop yield variations, leading to more informed decision-making. Furthermore, a chatbot has been developed to assist users in providing details and receiving crop predictions and recommendations. The study evaluates the performance of three machine learning algorithms—Random Forest, K-Nearest Neighbor, and Decision Tree—in developing the chatbot. By processing input data through these algorithms and comparing their outputs, the study determines the most accurate crop forecast and recommendation. This comparison also helps calculate the standard deviation of crop forecasts and recommendations, improving the model’s reliability. This research uniquely contributes to the agricultural sector by providing a practical tool for farmers, offering prioritized crop lists and an enhanced user interface. Ultimately, it aids farmers in making better-informed decisions and optimizing their agricultural practices.