Random Forest Algorithm Use For Crop Recommendatio
Random Forest Algorithm Use For Crop Recommendatio
1 [Link]
Email: *paithanepradip@[Link]
Copyright ©2023 by authors and Galileo Institute of Technology and Education of the Amazon (ITEGAM). This work is licensed
under the Creative Commons Attribution International License (CC BY 4.0).
teaches farmers how to choose the best crop for their soil system farmers to decide which crop to grow, when to plant it, and where
as well as the weather conditions in that place [4]. It suggests the to begin. Due to changes in seasonal weather patterns and
best lucrative crop for a certain location. Crop selection is based important resources like “soil”, “water”, and “air”, the use of
on economic and environmental aspects, with the goal of reducing various fertilizers is also unclear. Crop yields in this situation are
crop seed loss, efforts to take them, and components given to steadily declining. As a result of study, a ground-breaking system
them such as water and fertilizers. Crop projections are made for crop suggestion that addresses farmers' challenges has been
using a variety of variables such as “rainfall”, “temperature”, developed. The fundamental goal of our suggested approach is to
“area”, “soil type”, and so on. The method aids in determining the aid farmers in maximizing agricultural productivity and choosing
best time to apply fertilizer. The present crop production the most profitable crops suitable for their individual regions [10].
prediction system is hardware-based, costly to maintain, and The most significant promise of block-chain for the
complicated to utilize [5]. agricultural sector is that it will do away with the need for third
parties to guarantee trust in buyer-seller relationships or other
I.1 KEY CONTRIBUTIONS source-destination links. Blockchain technology enables peer-to-
peer transactions, which do away with the need for middlemen.
1) Error rate and accuracy comparisons for crop prediction for Peer-to-peer transactions are made possible by blockchain, which
specific regions using various machine learning approaches. also makes it possible to create "smart contracts" that carry out
2) A simple web application that any user (including farmers) can the terms of any agreement when specific conditions are met.
use to access a user-friendly web application that recommends the When something of value is exchanged, whether it is real
most lucrative crop. commodities, services, or money, the transaction can be
3) A GPS-based location identifier for retrieving rainfall and documented, providing a very long history of the product or
weather data estimates in a specific area. exchange from its origin to its destination. Blockchain technology
could be quite handy in this situation. Putting all data linked to
Weather forecasting has become extremely difficult as a agricultural happenings on a blockchain allows for the creation of
result of global warming and increased pollution. We use our a dependable and transparent system. Farmers also have rapid
traditional ways for crop selection because we have been farming access to information on a variety of areas, such as seed quality,
for so long. We determine which crop to take based solely on our weather and environment, payments, soil moisture, demand, and
assumptions, without employing any sophisticated sale price [11].
methodologies. These conventional systems rely solely on global Stable agricultural growth in India has raised questions.
weather, but because forecasting weather is difficult, the results Using data on paddy yield, area, and production from the years
can be disastrous for farmers. That is why, when making 1970–1971 to 2011–2012, an analysis of 41 years is conducted to
decisions such as which crop to plant, there should be a smart better understand the problem of instability in India's rice
system that will tell us which crop will produce the best results production. The research revealed that while the acreage, output,
depending on our soil as well as weather-based observations such and yield of rice had positive compound annual growth rates over
as temperature, rainfall, and ph. The system will employ an all of India, they had been steadily declining over time. There has
efficient algorithm to make the best decision about the main crop. been an increase in precariousness at the national level in India's
There are also dynamic parameters for soil type and weather regions, production, and rice yield over the past ten years (2000-
conditions [6]. Because of its accuracy, robustness, 01 to 2011-12). The rise in instability may have been caused by a
interpretability, scalability, and ability to manage missing data, decline in the usage of fertilizer, seeds, and other agricultural
the Random Forest algorithm is an excellent foundation for a crop inputs as well as a low ratio of irrigated land to total cropland.
recommendation system. Because of these characteristics, it is a The wholesale price of paddy has fluctuated considerably
popular candidate for machine learning-based crop between states during the reform, from 1990–1991 to 2016–17,
recommendation applications [7].The purpose is to anticipate the whereas the price of paddy harvested on farms has been less
most suited crop(s) to be grown on a specific farm or agricultural erratic. Although there has been a lot of research on agricultural
location given a set of input factors such as soil type, climate sector instability, this paper intends to explicitly look into the
conditions, crop traits, and historical yield data. The Random topic of instability in India's rice output. Over 10% of India's
Forest algorithm is used by the recommendation system to create entire agricultural production value is made up of paddy rice, with
these predictions [8]. The system's primary goal is to provide crop China being the world's top producer and India coming in second.
recommendations based on input factors such as soil type, climate Over 16 states' worth of farmers harvest rice, this is a basic crop
conditions, crop traits, and historical yield data. The system's goal for about 60% of the Indian population [12].
is to recommend the best crop(s) to grow in a certain agricultural A key viewpoint for securing a real-world and practical
region or farm. The system is strongly reliant on the availability solution to the crop yield problem is artificial intelligence (AI).
and accuracy of historical crop production data, soil data, climate By using directed learning, machine learning (ML) may predict
data, and other pertinent aspects. The accuracy and dependability an objective or result from a set of indicators. A good function
of suggestions might be impacted by limited or incomplete data must be created by a group of variables that will map the input
[9]. variable to the intended output in order to get the desired results.
The user enters the region and soil type as input. Machine Crop yield prediction includes predicting a crop's yield based on
learning algorithms can be used to determine the most profitable historical information such as temperature, humidity, pH, rainfall,
crop list or to estimate crop yield for a crop chosen by the user. and the crop's name. It provides information about the best crop
Machine Learning algorithms such as “Support Vector Machine that may be expected to be grown in a field [13]. These
(SVM)”, “Artificial Neural Network (ANN)”, “Random Forest predictions can be made using the machine learning method
(RF)”, “Multivariate Linear Regression (MLR)”, and “K-Nearest Random Forest. The crop prediction will be as precise as feasible.
Neighbor (KNN)” are used to forecast crop productivity. The The ideal crop yield model is found using the random forest
unpredictable nature of the environment makes it difficult for approach by considering the fewest number of models. Predicting
Page 35
Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.
crop yield is extremely useful in agriculture [14]. The suggested II. METHODOLOGY
approach functions as an informed and sophisticated tool for
farmers, taking into account a number of important elements like For farmers, crop production is a crucial piece of
soil quality, weather forecasts, and yield. The method improves information. Knowing the yield that lowers loss is really helpful.
precision, allowing farmers to maximize crop yield and eventually Farmers with experience used to predict the yield. The way the
boost earnings. The use of accurate data is necessary to achieve suggested system functions is likewise similar. It makes use of the
increased precision. The suggested system analyses all available historical data to predict the future yield. Crop productivity is
data using data mining techniques and delivers accurate harvest significantly impacted by both weather and pesticide use. It is
yield projections. With the aid of this forecast, farmers are better required for the accuracy of the data used to make this prediction.
equipped to understand their unique needs and make wise As a result, the proposed technique anticipates yield and
decisions [15]. minimizes losses.
Given data sets from the chosen region, the suggested
I.2 RESEARCH CONTRIBUTION model forecasts the crop. Integrating ML and agriculture will lead
to significant industry improvements.
1. In this research work, in detail comparison has been carried For forecasting current performance, past performance
out on various machine learning algorithm. data is crucial. Historical data is compiled from a variety of
2. The Random Forest algorithm provides higher result as trustworthy sources, including "[Link]," "[Link]," and
compare to other machine learning approaches "[Link]." Other databases including information
3. The proposed random forest algorithm works on the basis of on states and districts include soil type as an attribute. The
various variable parameters like rainfall, temperature, area, primary data set is combined with the soil type column that was
soil type, and various soil parameters. retrieved. Similar to this, average temperature and rainfall from a
4. The proposed random forest algorithm, predict the crop on the different dataset are added to the main data sets for the specific
basis of parameter used in dataset. place. The data sets have been organized and purified. The null
5. The accuracy of random forest algorithm is about 99.09%, and values are swapped out for the mean values. The attributes of the
which is higher than Decision tree with accuracy 90.00%, category are converted into labels before the algorithms are
Support Vector Machine with accuracy 97.90% and Logistic processed.
Regression with accuracy 95.22%.
Figure 1 depicts the architecture of the created crop data will be transformed into a numerical feature to produce an
recommender system. The main applications of the crop output with a higher yield and greater efficiency.
recommender system are: After that, we only choose the "Random Forest
The first step is to gather all the data (in the form of a Algorithm" from among the available methods because it
dataset) from all the locations. Since we are employing a produces a greater result. The rules generated by our algorithm
supervised machine learning technique, training will follow. are then represented in a figure, and they illustrate how our
Following that, there will be feature extraction, in which the raw system actually operates by selecting and forecasting the crop,
which is our ultimate objective [16].
Page 36
Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.
II.1 Algorithm: Random Forest 5. Then based on crop data, algorithm will calculate its
final output based on decision tree.
Steps:
6. Choose the prediction result with the most votes as the
1. Choose random samples from a given data or training
final prediction result.
set.
7. Find each decision tree's predictions for the new data
2. Make a decision tree for each piece of training data.
points and assign them to the category that receives the most
3. Then data is trained and tested based on dataset.
votes.
4. After training the data, real time weather data is
fetched into the system.
To increase the accuracy of the input dataset, the Random bigger. The strategy enhances the model and adds more diversity
Forest classifier applies a number of decision trees to various by searching for the best characteristics among the random
subsets of the input dataset and averages the results. The core of subset of features while splitting a node.
the trees is ensemble learning, a method for combining several For visualizing through-out the system, there is a login
classifiers to handle challenging problems and improve model system in which user first need to sign-up by his/her credentials
performance. The random tree uses the variation from each (like name, username, mobile number and password). After that
decision tree instead of relying solely on one, and it predicts the the user can login into system and need to click on ‘Get the
outcome based on votes for prediction maturity. Crop’ option.
The random forest algorithm builds a forest out of a
number of decision trees, adding randomness as the trees get
Page 37
Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.
After that a new page will open which asks your location Final output we get based on all of our values is the
and basic elements of your soil (like Nitrogen, Phosphorus and recommended crop that will get maximum yield or suitable for
Potassium value). Then some element like temperature are respective climate.
fetched from real time website, and based upon that model gives
recommendation for the crop. III. RESULTS AND DISCUSSIONS
Result Analysis for Crop Recommendation system vs.
Traditional Approach
Several elements should be taken into account when
comparing the result analysis between a Crop Recommendation
System employing machine learning and a Traditional Approach.
Here are some things to take into account when comparing the
outcomes of the two methods:
Page 38
Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.
Page 39
Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.
Table 1: Comparison of random forest algorithm using accuracy system offers recommendations that can help optimize
parameter. agricultural practices and maximize yields by utilizing historical
Sr. No Algorithm Accuracy crop yield data and analyzing the correlations between input
1 Random Forest 99.09% features and crop performance. The random forest algorithm's
2 Decision Tree 90.00% accuracy is higher than that of Naïve bias, SVM, Decision Tree,
3 Naïve Bayes 98.99% and Logistic Regression, but its execution time is longer than that
4 Support Vector Machine 97.64% of Decision Tree.
5 Logistic Regression 95.22% In future, to reduce execution time of random forest
Source: Author, (2023). algorithm is next step of this research
VI. REFERENCES
[1] Shilpa Mangesh Pande, Dr. Prem Kumar Ramesh, Anmol, B.R Aishwarya,
karuna Rohilla, Kumar Shaurya. “Crop recommender system using machine
learning approach”, Proceedings of the Fifth International Conference on
Computing Methodologies and Communication (ICCMC 2021) IEEE Aydin,
O.F., Gokasar, I. and Kalan, O., 2020. Matching algorithm for improving ride-
sharing by incorporating route splits and social factors. PloS one, 15(3),
p.e0229674.
[3] Jain A. “Analysis of growth and instability in the area, production, yield, and
price of rice in India”, Journal of Social Change and Development, 2018.
[5] Sagar BM, Cauvery NK., “Agriculture Data Analytics in Crop Yield
Estimation: A Critical Review”, Indonesian Journal of Electrical Engineering and
Computer Science, 2018 Dec;12(3):1087-93.
[6] Johnson LK, Bloom JD, Dunning RD, Gunter CC, Boyette MD, Creamer NG,
“Farmer harvest decisions and vegetable loss in primary production. Agricultural
Systems”, 2019 Nov 1;176:102672.
Figure 11: Confusion matrix of random forest algorithm.
Source: Author, (2023). [7] Sriram Rakshith.K, [Link].G, Rajesh M, Sudharshan K S, Vasanth ,S
Harish Kumar N, “A Survey on Crop Prediction using Machine Learning
Approach”, In International Journal for Research in Applied Science &
IV. CONCLUSIONS Engineering Technology (IJRASET), April 2019, pp( 3231-3234).
This research highlighted the limitations of current [8] S. Pavani, Augusta Sophy Beulet P., “Heuristic Prediction of Crop Yield Using
methods and their applicability for crop recommendation. The Machine Learning Technique”, International Journal of Engineering and
Advanced Technology (IJEAT), December 2019, pp(135-138).
proposed approach then connects the farmers with a functional
crop recommender system through a web application. The web [9] Nigam, Aruvansh, Saksham Garg, Archit Agrawal, and Parul Agrawal. "Crop
application gives users a number of options from which to choose yield prediction using machine learning algorithms." In 2019 Fifth International
a crop. Farmers that use the built-in suggestion technology can Conference on Image Information Processing (ICIIP), pp. 125-130. IEEE, 2019.
predict crop output. A user can research possible crops using the [10] Paithane, Pradip Mukundrao, and S. N. Kakarwal. "Automatic Pancreas
built-in recommender system to make better decisions. Machine Segmentation using A Novel Modified Semantic Deep Learning Bottom-Up
learning algorithm (Random Forest) is deployed on the Keggle Approach." International Journal of Intelligent Systems and Applications in
datasets that are provided, together with the rainfall data and real Engineering 10.1 (2022): 98-104.
meteorological data, and its prediction accuracy is evaluated. A [11] Paithane, Pradip M., S. N. Kakarwal, and D. V. Kurmude. "Automatic Seeded
useful technique for giving farmers and stakeholders data-driven Region Growing with Level Set Technique Used for Segmentation of Pancreas."
advice on the best crops for particular environmental conditions is Proceedings of the 12th International Conference on Soft Computing and Pattern
a crop recommendation system employing Random Forest. The Recognition (SoCPaR 2020) 12. Springer International Publishing, 2021.
Page 40
Paithane, ITEGAM-JETIA, Manaus, v.9 n.43, p. 34-41, Sept./Oct., 2023.
[14] Paithane, Pradip, Sarita Jibhau Wagh, and Sangeeta Kakarwal. "Optimization
of route distance using k-NN algorithm for on-demand food delivery." System
research and information technologies 1 (2023): 85-101.
Page 41