0% found this document useful (0 votes)
40 views51 pages

1822 B.E Cse Batchno 336

Uploaded by

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

1822 B.E Cse Batchno 336

Uploaded by

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

CROP RECOMMENDATION SYSTEM USING MACHINE

LEARNING ALGORITHM
Submitted in partial fulfillment of the requirements for
the award of Bachelor of Engineering Degree in
Computer Science and Engineering

By
LAKSHMAN KUMAR SERU
(38110515)
SAI MAANAS GANDHAM
(38110482)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


SCHOOL OF COMPUTING
SATHYABAMA INSTITUTE OF SCIENCE AND TECHNOLOGY
JEPPIAAR NAGAR, RAJIV GANDHI SALAI
CHENNAI – 600119, TAMIL NADU

April 2022

1
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
BONAFIDE CERTIFICATE

This is to certify that this Project Report is the bonafide work of Lakshman
Kumar Sreu (38110515) and Sai Maanas Gandham (38110482) who carried
out the project entitled “CROP RECOMMENDATION SYSTEM USING MACHINE
LEARNING ALGORITHM” under my supervision from November 2021 to April
2022.

Internal Guide

Dr. K. ASHOK KUMAR

Head of the Department


Dr. L. LAKSHMANAN, M.E., Ph.D.,
Dr. S. VIGNESHWARI, M.E., Ph.D.,

Submitted for Viva voce Examination held on

Internal Examiner External Examiner

2
DECLARATION

I Lakshman Kumar Seru (38110515) & Sai maanas Gandham (38110482)

hereby declare that the Project Report entitled “CROP RECOMMENDATION

SYSTEM USING MACHINE LEARNING ALGORITHM” done by me under

the guidance of Dr. K. Ashok Kumar (Internal Guide) at Sathyabama

Institute of Science and Technology, CHENNAI is submitted in partial

fulfillment of the requirements for the award of Bachelor of Engineering

degree in Computer Science and Engineering.

DATE:

PLACE: SIGNATURE OF THE CANDIDATE

3
ACKNOWLEDGEMENT

I am pleased to acknowledge my sincere thanks to the Board of


Management of SATHYABAMA for their kind encouragement in doing this
project and for completing it successfully. I am grateful to them.

I convey my thanks to Dr. T.Sasikala M.E., Ph.D., Dean, School of Computing


Dr. L. Lakshmanan M.E., Ph.D., and Dr. S. Vigneshwari M.E., Ph.D. Heads
of the Department of Computer Science and Engineering for providing me
necessary support and details at the right time during the progressive reviews.

I would like to express my sincere and deep sense of gratitude to my Project


Guide Dr. K. Ashok Kumar for his valuable guidance, suggestions and
constant encouragement paved the way for the successful completion of my
project work.

I wish to express my thanks to all Teaching and Non-teaching staff members


of the Department of Computer Science and Engineering who were
helpful in many ways for the completion of the project.

4
No. Title. Page No.
1 Abstract 6

2 Introduction 7

2 .1 Objective 8
3 Literature Survey 9-14
3.1 Existing System 15
3.2 Proposed System 16
4 Aim and Scope of 17
present investigation
5 18-33
Experimental or materials
and methods algorithms
used
6 Results and Discussions 34

6.1 Screenshots 34-36

7 Conclusion 37

8 References 38

9 Source Code 39

5
1. ABSTRACT

Crop Recommendation System for agriculture is based on various input


parameters. This proposes a hybrid model for recommending crops to south
Indian states by considering various attributes such as soil type, Rainfall,
Groundwater level, Temperature, Fertilizers, Pesticides and season.
The recommender model is built as a hybrid model using the classifier
machine learning algorithm. Based on the appropriate parameters, the system
will recommend the crop.
Technology based crop recommendation system for agriculture helps the
farmers to increase the crop yield by recommending a suitable crop for their
land with the help of geographic and the climatic parameters.
The proposed hybrid recommender model is found to be effective in
recommending a suitable crop. Crop yield production value updation has a
positive practical significance for guiding agricultural production and for
notifying the change in market rate of crop to the farmer.
The concept of this paper is to implement the crop selection method so that
this method helps in solving many agriculture and farmers problems. This
improves our Indian economy by maximizing the yield rate of crop
production. Different types of land condition. So the quality of the crops are
identified using ranking process. By this process the rate of the low quality
and high quality crop is also notified.
The usage of ensemble of classifiers paves a path way to make a better
decision on predictions due to the usage of multiple classifiers. Further, a
ranking process is applied for decision making in order to select the classifiers
results. This system is used to predict the cost of crop which is yielded for
further.

6
2. INTRODUCTION

In the world of developing technologies, the success of sharing information will


help the agriculturists in realizing and developing their potential. The information
sharing is that the valuable and timely information is being shared between
agriculturists, either formally or informally. The willingness of information sharing
refers to the open attitude among agriculturists. This open attitude determines the
degree and scope of information sharing. Using web-technologies like html and
css we build the web application, we create dataset by gathering data from
multiple resources and place them in place which is used to predict the price of the
crop and results are subjected to non-linear test later priorities are set and
rankings are given to the list of crops. Place information in our application and
share that information to agriculturists whose data is collected and stored in the
mysql server. we software to automatically send the updated information to the
agriculturists in the form of text message. So that agriculturists no need to go to
near by towns and cities to know the updated information. We will be machine
learning algorithms to predict the price of the crop for the next two months. For
prediction purpose we will be using Support vector machine(SVM), Naïve Baye’s
(NB) and K-Nearest Neighbour(KNN) algorithms to predict the cost of the crop
production. Further, a ranking process is applied for decision making in order to
select the classifiers results.

7
2.1 OBJECTIVE

● Data set collection from various sources.


● Data parsing and cleansing technique is applied to make the raw data into
processing data.
● The data collected is subject to machine learning system along with run
time analysis makes an efficient crop value updation system.
● Usage of Ensemble of classifiers makes the model more robust and
efficient.
● Ranking technique used in the project helps us to make efficient decisions.
● Creating a web application for user registrations and collection of data.
● The main objective is to obtain a better variety of crops that can be grown
over the season. The proposed system would help to minimize the
difficulties faced by farmers in choosing a crop and maximize the yield.
● The model predicts the crop yield by studying factors such as rainfall,
temperature, area, season, soil type etc.

8
3. LITERATURE SURVEY

[1]Title: A Review on Data Mining Techniques for Fertilizer Recommendation


2018.
Authors : Jignasha M. Jethva, Nikhil Gondaliya, Vinita Shah

To keep up nutrition levels in the soil in case of deficiency, fertilizers are added to
soil. The standard issue existing among the Indian agriculturists choose
approximate amount of fertilizers and add them manually. Excess or deficient
extension of fertilizers can harm the plants life and reduce the yield. This paper
gives overview of various data mining frameworks used on cultivating soil dataset
for fertilizer recommendation.

[2]Title: A Survey on Data Mining Techniques in Agriculture, 2015.

Authors : M.C.S.Geetha

Agriculture is the most critical application area especially in the developing nations
like India .Use of information technology in agriculture can change the situation of
decision making and farmers can yield in better way.. This paper integrates the
work of several authors in a single place so it is valuable for specialists to get data
of current situation of data mining systems and applications in context to farming
field.

[3]Title : AgroNutri Android Application,2016.

Authors : S. Srija, R. Geetha Chanda, S.Lavanya, Dr. M. Kalpana Ph.D

This paper communicates the idea regarding the making of AgroNutri an android
application that helps in conveying the harvest particular fertilizer amount to be
applied. The idea is to calculate the measure of NPK composts to be applied
depend on the blanked proposal of the crop of interest. This application works
depend on the product chosen by the farmer and that is taken as input, thus
providing the farmers. The future scope of the AgroNutri is that GPRS can be
included so that according to location nutrients are suggested.

9
[4]Title: Machine Learning: Applications in Indian Agriculture, 2016.

Authors: Karandeep Kaur

Agriculture is a field that has been lacking from adaption of technologies and their
advancements. Indian agriculturists should be up to the mark with the universal
procedures. Machine learning is a native concept that can be applied to every field
on all inputs and outputs. It has effectively settled its ability over ordinary
calculations of software engineering and measurements. Machine learning
calculations have improved the exactness of artificial intelligence machines
including sensor based frameworks utilized in accuracy farming. This paper has
evaluated the different uses of machine learning in the farming area. It additionally
gives a knowledge into the inconveniences looked by Indian farmers and how they
can be resolved using these procedures.

[5]Title: Impacts of population growth, economic development, and technical


change on global food production and consumption, 2011.

Author: Uwe A. Schneider a,⇑, Petr Havlik b, Erwin Schmid c, Hugo Valin b,
Aline Mosnier b,c, Michael Obersteiner b, Hannes Bottcher b, Rastislav
Skalsky´ d, Juraj Balkovicˇ d, Timm Sauer a, Steffen Fritz b

Throughout the following decades humanity will request more food from less land
and water assets. This investigation evaluates the food production effects of four
elective advancement situations from the Millennium Ecosystem Assessment and
the Special Report on Emission Scenarios. partialy and jointly considered are land
and water supply impacts from population development, and specialized change,
and forests and agriculture demand request shifts from population development
and economic improvement. The income impacts on nourishment request are
registered with dynamic flexibilities. Worldwide farming area increments by up to
14% somewhere in the range of 2010 and 2030.Deforestation restrictions strongly
impact the price of land and water resources but have little consequences for the
global level of food production and food prices. While projected income changes
have the highest partial impact on per capita food consumption levels, population
growth leads to the highest increase in total food production. The impact of
technical change is amplified or mitigated by adaptations of land management
intensities

10
[6]Title: Brief history of agricultural systems modelling,2016.

Author: James W. Jones a,⁎, John M. Antle b, Bruno O. Basso c, Kenneth J.


Boote a, Richard T. Conant d, Ian Foster e, H. Charles J. Godfray f, Mario
Herrero g, Richard E. Howitt h, Sander Jansseni, Brian A. Keating g, Rafael
Munoz-Carpena a, Cheryl H. Porter a, Cynthia Rosenzweig j, Tim R.Wheeler k

Rural frameworks science creates information that enables analysts to consider


complex issues or take educated farming choices. The rich history of this science
represents the decent variety of frameworks and scales over which they work and
have been contemplated. Demonstrating, a basic apparatus in agrarian
frameworks science, has been expert by researchers from an extensive variety of
controls, who have contributed ideas and instruments over six decades. As
agrarian researchers currently consider the "people to come" models, information,
and learning items expected to meet the inexorably mind boggling frameworks
issues looked by society, it is vital to check out this history and its exercises to
guarantee that we stay away from re-innovation and endeavor to think about all
elements of related difficulties. To this end, we outline here the historical backdrop
of rural frameworks demonstrating and distinguish exercises discovered that can
help control the structure and advancement of up and coming age of farming
framework apparatuses and techniques. Various past occasions joined with
generally innovative advancement in different fields have unequivocally added to
the development of farming framework demonstrating, including improvement of
process-based bio-physical models of yields and domesticated animals, factual
models dependent on verifiable perceptions, and financial streamlining and
reproduction models at family unit and local to worldwide scales. Attributes of rural
frameworks models have changed broadly relying upon the frameworks included,
their scales, and the extensive variety of purposes that spurred their advancement
and use by specialists in various controls. Late patterns in more extensive joint
effort crosswise over establishments, crosswise over orders, and between people
in general and private segments recommend that the stage is set for the significant
advances in rural frameworks science that are required for the up and coming age
of models, databases, learning items and choice emotionally supportive networks.

11
[7]Title: A Smart Agricultural Model by Integrating Iot, Mobile and
Cloud-based Big Data Analytics, 2017.

Authors: S.Rajeswari, K.Suthendran, K.Rajkumar.

In the cultivating field, the system models play a significant role to the
enhancement of the agro-normal and money related conditions. In the proportions
of benefits of the field and farm examinations to give the information and to
recognize fitting and fruitful organization practices. It can recognize the
organization to arrive managers and transversely over reality as long as the
required soil, the board, environment, and money related information. Decision
Support Systems (DSSs) use to make the information for the vermin the board,
develop the officials. These systems are not using the impelled strategies to
process the data. Thusly, use the adroit system thoughts to take the decisions for
the issue. It expects a crucial activity in the comprehension of agronomic results,
and their use as decision sincerely steady systems for farmers is extending.

[8]Title: An Overview of Internet of Things and Data Analytics in Agriculture:


Benefits and Challenges, 2018.

Authors: Olakunle Elijah, Tharek Abdul Rahman, Igbafe Orikumhi, Chee Yen
Leow, Nour Hindia.

A blueprint of Iot and DA in agriculture has been shown in this paper. A couple of
zones related to the association of Iot in agribusiness have been discussed in
detail. The investigation of composing exhibits that there are clusters of work
advancing being produced of Iot development that can be used to increase
operational efficiency and gainfulness of plant and creatures. The benefits of Iot
and DA, and open troubles have been identified and inspected in this paper. Iot is
depended upon to offer a couple of benefits to the agribusiness division.
Regardless, there are up 'til now different issues to be steered to make it moderate
for close to nothing and medium-scale farmers. The key issues are security and
cost. It is typical that as contention increases in the cultivating part

12
[9]Title: Circulation Mode Selection Based on Cost Analysis, 2017.

Authors: Xiurong Sun*, Jingshan Zhang, Chenglin Wang, Tao Zhang

If every farmer and each average production base will join their optimal conditions
in making cooperatives, it will accomplish economies of scale. Furthermore,
producers will have an all the more favourable position in the plans with
downstream firms (shipper or retailer).Second, the main customers of wholesale
market are not inhabitants nearby who buy small quantities products but lower
distributors or retailers. More redesigned transportation mode respects intensive
attempt of new agrarian things, which prompts bolster the movement of new chain
joint logistics and strengthen resource utilize and made logistics advantage quality.
Refresh everything considered agrarian things spread. By then, regard the
examination of gigantic worth control of standard things and achieve the mind
blowing control to stream process.

[10]Title: Support Vector Machine-based Fuzzy Self-learning Control for


Induction Machines, 2010.

Authors : Zongkai Shao

Using support vector machine (SVM) is to realize the self learning of fuzzy
inference system (FIS), based on a fast modified varying metric method (MDFP)
and a support vector machine identifier (SVMI), a SVM-FIS self-learning controller
for the threephase induction machine adjustable speed system has been
designed. The proposed controller is not only of the advantages that FIS does not
depend on the plant model, strong robustness, and adaptive self-learning ability,
but also learning ability and generalization performance of SVM. The designed
processes of SVM-FIS, MDFP, and SVMI algorithms have been described in
details. Simulation results show the feasibility, correctness and effectiveness of the
proposed control strategy, such as the excellent static and dynamic performances,
and strong anti-interference ability.

13
[11]Title: Machine Learning Facilitated Rice Prediction in Bangladesh, 2015.

Authors: Mohammad Motiur Rahman, Naheena Haq, Rashedur M Rahman

In this examination, self organising map (SOM) was utilized to group the
information relationship between the information factors. After that chi-square test
strategy was utilized to set up the level of reliance between the related variable
qualities. It was discovered that the day by day outrageous climate conditions, for
example, most extreme and least fluctuation in temperature, precipitation,
dampness and wind speed were the principle drivers of product development,
yield and wine quality

[12]Title: Support Vector Machine-Based Classification Scheme of Maize


Crop, 2017.

Authors: Suhas S Athani, CH Tejeshwar

This paper says about, advancement of a mechanized framework to distinguish


and group weeds from the products would be of extraordinary help and we have
proposed a set-up that decreases labour. We have considered pictures of maize
edits as the informational index. Separating surface highlights of the picture and
applying SVM (support vector machine) to arrange whether the given picture is a
weed or a yield brought about a precision of 82%. The proposed framework gives
a chance to investigate more about element extraction methods.

[13]Title: WITH MACHINE LEARNING ALGORITHMS FOR ESTIMATING


WINTER WHEAT AREAS, 2017.

Authors: Y.Z. Pan2

we utilize different kernel functions in the CPPI models to depict the connection
between fractional winter wheat area and MODIS EVI time series data. We tried
three straight and non-direct kernel functions, including linear regression, artificial
neural system, and support vector machine.. For areas like DT where multiple crop
types have comparative phenology cycles, ANN-CPPI is found to play out the
best. The two crop types to be specific winter wheat and rapeseed, can be
separated well. These tests give elective answers for the uses of CPPI in mixed
areas.

14
3.1 EXISTING SYSTEM

The computational and data demands of structural price forecasting generally far
exceed than what is routinely available in developing countries. Consequently,
researchers often rely on parsimonious representations of price processes for their
forecasting needs. Contemporary parsimonious form of price forecasting relies
heavily on time series modelling. In time series modelling, past observations of
the same variable are collected and analyzed to develop a model describing the
underlying relationship. During the past few decades, much effort has been
devoted to the development and improvement of time series forecasting models.
Time series modelling requires less onerous data input for regular and up-to date
price forecasting. Hence there is a need for better classification which would be an
ensemble or hybrid classification model.

DISADVANTAGES OF EXISTING SYSTEM

● Efficiency is low.
● The existing system which recommends crop yield is either hardware-based
being costly to maintain, or not easily accessible.
● Despite many solutions that have been recently proposed, there are still
open challenges in creating a user-friendly application with respect to crop
recommendation.
● More number of repeated work.

15
3.2 PROPOSED SYSTEM

In proposed system, the data analysis technology is used to update the crop yield
rate change. The concept of this paper is to implement the crop selection method
so that this method helps in solving many agriculture and farmers problems. This
improves our Indian economy by maximizing the yield rate of crop production.
Different types of land condition. So the quality of the crops are identified using
ranking process. By this process the rate of the low quality and high quality crop is
also intimated. The usage of ensemble of classifiers paves a path way to make a
better decision on predictions due to the usage of multiple classifiers. Further, a
ranking process is applied for decision making in order to select the classifiers
results. This system is used to predict the cost of the fertilizers for further. This
project uses Ensemble of classifiers such as Decision tree and Random forest
classifier. In addition, this project uses Ranking technique.

ADVANTAGES OF PROPOSED SYSTEM

● Useful to people far away from towns/cities.


● Better time efficiency.
● Reduction of repeated work.

16
4. AIM AND SCOPE OF THE PRESENT INVESTIGATION

4.1 Aim:
Our Aim from the project is to make a ML model which takes student data trains
itself using various Machine Learning techniques and Algorithms(Random Forest,
Decision Tree) and predict the yield and best fertilizer that suits for the crops in
virtual environment by considering the overall factors that contribute in his overall
yield.

Secondly, to learn the required tech stacks and use it to make model with an
python application and lastly to execute it get output about yield and best fertilizer
for the crop.

4.2 Scope:

This Project can be used to get the student performance with more accuracy than
any other model published earlier and we can also make some mobile or web
application based on the model.

17
5. EXPERIMENTAL OR MATERIALS AND METHODS;

ALGORITHAMS USED.

5.1 RANDOM FOREST ALGORITHAM:

Random Forest is a popular machine learning algorithm that belongs to the


supervised learning technique. It can be used for both Classification and
Regression problems in ML. It is based on the concept of ensemble
learning, which is a process of combining multiple classifiers to solve a complex
problem and to improve the performance of the model.
As the name suggests, "Random Forest is a classifier that contains a number of
decision trees on various subsets of the given dataset and takes the average to
improve the predictive accuracy of that dataset."
Instead of relying on one decision tree, the random forest takes the prediction
from each tree and based on the majority votes of predictions, and it predicts the
final output.
The greater number of trees in the forest leads to higher accuracy and prevents
the problem of over fitting.
Random Forest works in two-phase first is to create the random forest by
combining N decision tree, and second is to make predictions for each tree
created in the first phase.
The Working process can be explained in the below steps:
Step-1: Select random K data points from the training set.
Step-2: Build the decision trees associated with the selected data points.
Step-3: Choose the number N for decision trees that you want to build.
Step-4: Repeat Step 1 & 2.
Step-5: For new data points, find the predictions of each decision tree, and assign
the new data points to the category that wins the majority votes.

5.2 DECISION TREE:

Decision Tree is a Supervised learning technique that can be used for both
classification and Regression problems, but mostly it is preferred for solving
Classification problems. It is a tree-structured classifier, where internal nodes

18
represent the features of a dataset, branches represent the decision
rules and each leaf node represents the outcome.

In a Decision tree, there are two nodes, which are the Decision Node and Leaf
Node.

Decision nodes are used to make any decision and have multiple branches,
whereas Leaf nodes are the output of those decisions and do not contain any
further branches.

The decisions or the test are performed on the basis of features of the given
dataset. It is a graphical representation for getting all the possible solutions to a
problem/decision based on given conditions.

It is called a decision tree because, similar to a tree, it starts with the root node,
which expands on further branches and constructs a tree-like structure.

In order to build a tree, we use the CART algorithm, which stands for Classification
and Regression Tree algorithm.

A decision tree simply asks a question, and based on the answer (Yes/No), it
further split the tree into subtrees.

The complete process can be better understood using the below algorithm:

Step-1: Begin the tree with the root node, says S, which contains the complete
dataset.

Step-2: Find the best attribute in the dataset using Attribute Selection Measure
(ASM).

Step-3: Divide the S into subsets that contains possible values for the best
attributes.

Step-4: Generate the decision tree node, which contains the best attribute.

Step-5: Recursively make new decision trees using the subsets of the dataset
created in step -3. Continue this process until a stage is reached where you
cannot further classify the nodes and called the final node as a leaf node.

5.3 SYSTEM ARCHITECTURE:

19
5.4 SYSTEM REQUIREMENTS:

5.4.1 HARDWARE REQUIREMENTS:

● System: Pentium Dual Core.


● Hard Disk: 40 GB.
● Monitor: 15’’ LED
● Ram: 4 GB

5.4.2 SOFTWARE REQUIREMENTS:

● Operating system: Windows 7/10.


● Coding Language: Python.

5.5 SOFTWARE ENVIRONMENT

20
Python:

Python is a high-level, interpreted, interactive and object-oriented scripting


language. Python is designed to be highly readable. It uses English keywords
frequently where as other languages use punctuation, and it has fewer syntactical
constructions than other languages.

● Python is Interpreted − Python is processed at runtime by the interpreter.


You do not need to compile your program before executing it. This is similar
to PERL and PHP.

● Python is Interactive − You can actually sit at a Python prompt and


interact with the interpreter directly to write your programs.

● Python is Object-Oriented − Python supports Object-Oriented style or


technique of programming that encapsulates code within objects.

● Python is a Beginner's Language − Python is a great language for the


beginner-level programmers and supports the development of a wide range
of applications from simple text processing to WWW browsers to games.

History of Python:

Python was developed by Guido van Rossum in the late eighties and early
nineties at the National Research Institute for Mathematics and Computer Science
in the Netherlands.

Python is derived from many other languages, including ABC, Modula-3, C, C++,
Algol-68, SmallTalk, and Unix shell and other scripting languages.

Python is copyrighted. Like Perl, Python source code is now available under the
GNU General Public License (GPL).

Python is now maintained by a core development team at the institute, although


Guido van Rossum still holds a vital role in directing its progress.

21
Python Features:

Python's features include −

● Easy-to-learn − Python has few keywords, simple structure, and a clearly


defined syntax. This allows the student to pick up the language quickly.

● Easy-to-read − Python code is more clearly defined and visible to the eyes.

● Easy-to-maintain − Python's source code is fairly easy-to-maintain.

● A broad standard library − Python's bulk of the library is very portable and
cross-platform compatible on UNIX, Windows, and Macintosh.

● Interactive Mode − Python has support for an interactive mode which


allows interactive testing and debugging of snippets of code.

● Portable − Python can run on a wide variety of hardware platforms and has
the same interface on all platforms.

● Extendable − You can add low-level modules to the Python interpreter.


These modules enable programmers to add to or customize their tools to be
more efficient.

● Databases − Python provides interfaces to all major commercial


databases.

● GUI Programming − Python supports GUI applications that can be created


and ported to many system calls, libraries and windows systems, such as
Windows MFC, Macintosh, and the X Window system of Unix.

● Scalable − Python provides a better structure and support for large


programs than shell scripting.

5.6 MODULES:

22
● Admin Login
● Metadata
● Data Pre-processing
● Crop Prediction Module
● Crop Recommendation Module

MODULES DESCRIPTION:

Admin Login:

This is the first activity, Admin needs to provide a correct contact number and a
password, which user enters while registering, in order to login into the webpage.
If information provided by the admin matches with the data in the database table
then user successfully login into the webpage else message of login failed is
displayed and user need to re-enter correct information.

Metadata:
All the main data used in the data set are initialized with the number to use in the
algorithm it is like initializing all the details. In this metadata, we are going to
initialize all the crop names with the numbers. This data makes us use the data
easily in the algorithm. Hear the metadata of all the crops is given with a particular
number. This number is not duplicated that is one number is given to one crop, the
same number is not given to the other crop. This metadata consists of more than
a hundred crops that grown all over India.

Data Pre-processing:

Hear the raw data in the crop data is cleaned and the metadata is appending to it
by removing the things which are converted to the integer. So, the data is easy to
train. Hear all the data. In this pre-processing, we first load the metadata into this
and then this metadata will be attached to the data and replace the converted data
with metadata. Then this data will be moved further and remove the unwanted
data in the list and it will divide the data into the train and the test data.

Crop Prediction Module:

23
The obtained result will be helpful for the farmers to know the Yield of the crop so,
he can go for the better crop which gives high yield and also say them the efficient
use of agriculture field. This way we can help the farmers to grow the crop which
gives them better yield.

Crop Recommendation Module:

In this module, we have proposed a model that addresses these issues. The
novelty of the proposed system is to guide the farmers to maximize the crop yield
as well as suggest the most profitable crop for the specific region.

5.7 UML DIAGRAMS:


UML is simply anther graphical representation of a common semantic
model. UML provides a comprehensive notation for the full lifecycle of
object-oriented development.

ADVANTAGES
● To represent complete systems using object oriented concepts
● To establish an explicit coupling between concepts and executable code
● To take into account the scaling factors that are inherent to complex and
● Critical end.
● To creating a modelling language usable by both humans and machines

UML defines several models for representing systems

● The class model captures the static structure


● The state model expresses the dynamic behavior of objects
● The use case model describes the requirements of the user
● The interaction model represents the scenarios and messages flows
● The implementation model shows the work units
● The deployment model provides details that pertain to process .

5.7.1 DATA FLOW DIAGRAM:

1. The DFD is also called as bubble chart. It is a simple graphical formalism


that can be used to represent a system in terms of input data to the system,

24
various processing carried out on this data, and the output data is
generated by this system.
2. The data flow diagram (DFD) is one of the most important modeling tools. It
is used to model the system components. These components are the
system process, the data used by the process, an external entity that
interacts with the system and the information flows in the system.
3. DFD shows how the information moves through the system and how it is
modified by a series of transformations. It is a graphical technique that
depicts information flow and the transformations that are applied as data
moves from input to output.
4. DFD is also known as bubble chart. A DFD may be used to represent a
system at any level of abstraction. DFD may be partitioned into levels that
represent increasing information flow and functional detail.

5.7.2 USECASE DIAGRAM:

25
Use case diagrams overview the usage requirement for system. They are
useful for presentations to management and/or project stakeholders, but
for actual development you will find that use cases provide significantly
more value because they describe “the meant” of the actual requirements.
A use case describes a sequence of action that provides something of
measurable value to an action and is drawn as a horizontal ellipse.

5.7.3 ACTIVITY DIAGRAM:

Activity diagram are graphical representations of workflows of stepwise activities


and actions with support for choice, iteration and concurrency. The activity
diagrams can be used to describe the business and operational step-by-step
workflows of components in a system. Activity diagram consist of Initial node,
activity final node and activities in between.

5.9 INPUT DESIGN AND OUTPUT DESIGN:

26
5.9.1 INPUT DESIGN:

The input design is the link between the information system and the user. It
comprises the developing specification and procedures for data preparation and
those steps are necessary to put transaction data in to a usable form for
processing can be achieved by inspecting the computer to read data from a written
or printed document or it can occur by having people keying the data directly into
the system. The design of input focuses on controlling the amount of input
required, controlling the errors, avoiding delay, avoiding extra steps and keeping
the process simple. The input is designed in such a way so that it provides security
and ease of use with retaining the privacy. Input Design considered the following
things:

⮚ What data should be given as input?


⮚ How the data should be arranged or coded?
⮚ The dialog to guide the operating personnel in providing input.
⮚ Methods for preparing input validations and steps to follow when error
occur.

OBJECTIVES:

1. Input Design is the process of converting a user-oriented description of the input


into a computer-based system. This design is important to avoid errors in the data
input process and show the correct direction to the management for getting correct
information from the computerized system.

2. It is achieved by creating user-friendly screens for the data entry to handle large
volume of data. The goal of designing input is to make data entry easier and to be
free from errors. The data entry screen is designed in such a way that all the data
manipulates can be performed. It also provides record viewing facilities.

3. When the data is entered it will check for its validity. Data can be entered with
the help of screens. Appropriate messages are provided as when needed so that
the user will not be in maize of instant. Thus the objective of input design is to
create an input layout that is easy to follow

5.9.2 OUTPUT DESIGN:

27
A quality output is one, which meets the requirements of the end user and
presents the information clearly. In any system results of processing are
communicated to the users and to other system through outputs. In output design
it is determined how the information is to be displaced for immediate need and
also the hard copy output. It is the most important and direct source information to
the user. Efficient and intelligent output design improves the system’s relationship
to help user decision-making.

1. Designing computer output should proceed in an organized, well thought out


manner; the right output must be developed while ensuring that each output
element is designed so that people will find the system can use easily and
effectively. When analysis design computer output, they should Identify the specific
output that is needed to meet the requirements.

2. Select methods for presenting information.

3. Create document, report, or other formats that contain information produced by


the system.

The output form of an information system should accomplish one or more of the
following objectives.

❖ Convey information about past activities, current status or projections of the


❖ Future.
❖ Signal important events, opportunities, problems, or warnings.
❖ Trigger an action.
❖ Confirm an action.

28
5.10 SYSTEM STUDY:

FEASIBILITY STUDY:

The feasibility of the project is analyzed in this phase and business proposal is put
forth with a very general plan for the project and some cost estimates. During
system analysis the feasibility study of the proposed system is to be carried out.
This is to ensure that the proposed system is not a burden to the company. For
feasibility analysis, some understanding of the major requirements for the system
is essential.
Three key considerations involved in the feasibility analysis are

♦ ECONOMICAL FEASIBILITY
♦ TECHNICAL FEASIBILITY
♦ SOCIAL FEASIBILITY
ECONOMICAL FEASIBILITY:

This study is carried out to check the economic impact that the system will have on
the organization. The amount of fund that the company can pour into the research
and development of the system is limited. The expenditures must be justified.
Thus the developed system as well within the budget and this was achieved
because most of the technologies used are freely available. Only the customized
products had to be purchased.

TECHNICAL FEASIBILITY:

This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand
on the available technical resources. This will lead to high demands on the
available technical resources. This will lead to high demands being placed on the
client. The developed system must have a modest requirement, as only minimal or
null changes are required for implementing this system.

SOCIAL FEASIBILITY:

29
The aspect of study is to check the level of acceptance of the system by the user.
This includes the process of training the user to use the system efficiently. The
user must not feel threatened by the system, instead must accept it as a necessity.
The level of acceptance by the users solely depends on the methods that are
employed to educate the user about the system and to make him familiar with it.
His level of confidence must be raised so that he is also able to make some
constructive criticism, which is welcomed, as he is the final user of the system.

SYSTEM TESTING:
The purpose of testing is to discover errors. Testing is the process of trying to
discover every conceivable fault or weakness in a work product. It provides a way
to check the functionality of components, sub assemblies, assemblies and/or a
finished product It is the process of exercising software with the intent of ensuring
that the

Software system meets its requirements and user expectations and does not fail in
an unacceptable manner. There are various types of test. Each test type
addresses a specific testing requirement.

TYPES OF TESTS:
Unit testing:
Unit testing involves the design of test cases that validate that the internal program
logic is functioning properly, and that program inputs produce valid outputs. All
decision branches and internal code flow should be validated. It is the testing of
individual software units of the application .it is done after the completion of an
individual unit before integration. This is a structural testing, that relies on
knowledge of its construction and is invasive. Unit tests perform basic tests at
component level and test a specific business process, application, and/or system
configuration. Unit tests ensure that each unique path of a business

process performs accurately to the documented specifications and contains clearly


defined inputs and expected results.

Integration testing:
Integration tests are designed to test integrated software components to determine
if they actually run as one program. Testing is event driven and is more concerned
with the basic outcome of screens or fields. Integration tests demonstrate that

30
although the components were individually satisfaction, as shown by successfully
unit testing, the combination of components is correct and consistent. Integration
testing is specifically aimed at exposing the problems that arise from the
combination of components.

Functional test:
Functional tests provide systematic demonstrations that functions tested are
available as specified by the business and technical requirements, system
documentation, and user manuals.

Functional testing is centered on the following items:

Valid Input : identified classes of valid input must be accepted.

Invalid Input : identified classes of invalid input must be rejected.

Functions : identified functions must be exercised.

Output : identified classes of application outputs must be exercised.

Systems/Procedures: interfacing systems or procedures must be invoked.

Organization and preparation of functional tests is focused on requirements, key


functions, or special test cases. In addition, systematic coverage pertaining to
identify Business process flows; data fields, predefined processes, and successive
processes must be considered for testing. Before functional testing is complete,
additional tests are identified and the effective value of current tests is determined.

System Test:
System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An
example of system testing is the configuration oriented system integration
test.System testing is based on process descriptions and flows, emphasizing
pre-driven process links and integration points.

White Box Testing:


White Box Testing is a testing in which in which the software tester has
knowledge of the inner workings, structure and language of the software, or at
least its purpose. It is purpose. It is used to test areas that cannot be reached from
a black box level.

31
Black Box Testing:
Black Box Testing is testing the software without any knowledge of the inner
workings, structure or language of the module being tested. Black box tests, as
most other kinds of tests, must be written from a definitive source document, such
as specification or requirements document, such as specification or requirements
document. It is a testing in which the software under test is treated, as a black box
.you cannot “see” into it. The test provides inputs and responds to outputs without
considering how the software works.

Unit Testing:

Unit testing is usually conducted as part of a combined code and unit test phase of
the software lifecycle, although it is not uncommon for coding and unit testing to be
conducted as two distinct phases.

Test strategy and approach


Field testing will be performed manually and functional tests will be written in
detail.
Test objectives:

● All field entries must work properly.


● Pages must be activated from the identified link.
● The entry screen, messages and responses must not be delayed.

Features to be tested:

● Verify that the entries are of the correct format


● No duplicate entries should be allowed
● All links should take the user to the correct page

Integration Testing:
Software integration testing is the incremental integration testing of two or more
integrated software components on a single platform to produce failures caused by
interface defects.

32
The task of the integration test is to check that components or software
applications, e.g. components in a software system or – one step up – software
applications at the company level – interact without error.

Test Results: All the test cases mentioned above passed successfully. No defects
encountered.

Acceptance Testing:
User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional
requirements.

Test Results: All the test cases mentioned above passed successfully. No defects
encountered.

6 RESULTS AND DISCUSSIONS:


In this project the data analysis technology is used to update the rate change
through notification. Further, a ranking process is applied for decision making

33
in order to select the classifiers results. This system is used to predict the cost
of the crop yield.

6.1 SCREENSHOTS

34
35
36
7. CONCLUSION

This open attitude determines the degree and scope of information sharing. Big
data analysis technology can effectively improve the crop yield production is
updation. This project proposes a novel intelligent system for agricultural crop
price prediction. The key idea is to use ensemble of classifiers for prediction.
The usage of ensemble of classifiers paves a path way to make a better
decision on predictions due to the usage of multiple classifiers. Further, a
ranking process is applied for decision making in order to select the classifiers
results. This system is used to predict the cost of the crop rate for further.

The solution will benefit farmers to maximize productivity in agriculture, reduce


soil degradation in cultivated fields, and reduce fertilizer use in crop production
by recommending the right crop by considering various attributes.

This would provide a comprehensive prediction on the basis of geographical,


environmental and economic aspects.

37
8. REFERENCES

[1] Manpreet Kaur, Heena Gulati, Harish Kundra, “Data Mining in Agriculture on
Crop Price Prediction: Techniques and Applications”, International Journal of
Computer Applications, Volume 99– No.12, August 2014.

[2] J. Meng, “Research on the cost of agricultural products circulation and its
control under the new normal economic development,” Commercial Times, no. 23,
pp. 145147, 2016.

[3] A. Kaloxylos et al., “Farm management systems and the future Internet era,”
Comput. Electron. Agricult., vol. 89, pp. 130–144, Nov. 2012.

[4] N. N. Li, T. S. Li, Z. S. Yu, Y. Rui, Y. Y. Miao, and Y. S. Li, “Factors influencing
farmers’ adoption of new technology based on Logistic-ISM model-a case study of
potato planting technology in Dingxi City, Gansu Province,” Progress in
Geography, vol. 33, no. 4, pp. 542-551, 2014.

[5] Y. Wang, "A neural network adaptive control based on rapid learning method
and its application," Advances In Modeling and Analysis, Vol. 46(3), pp.
27-34,1994.

38
9. SOURCE CODE

import numpy as np

import pandas as pd

from flask import Flask, request, jsonify, render_template, redirect, flash,


send_file

from sklearn.preprocessing import MinMaxScaler

from werkzeug.utils import secure_filename

import pickle

import numpy as np

import pandas as pd

from flask import Flask, request, jsonify, render_template, redirect, flash,


send_file

from sklearn.preprocessing import MinMaxScaler

from werkzeug.utils import secure_filename

import pickle

import numpy as np

import pandas as pd

from sklearn.tree import DecisionTreeClassifier

39
from sklearn.ensemble import RandomForestClassifier, BaggingClassifier,
AdaBoostClassifier, VotingClassifier

app = Flask(__name__) #Initialize the flask App

#forest = pickle.load(open('boosting.pkl','rb'))

crop = pickle.load(open('crop.pkl','rb'))

@app.route('/')

@app.route('/index')

def index():

return render_template('index.html')

@app.route('/analysis')

def analysis():

return render_template('analysis.html')

@app.route('/chart')

def chart():

return render_template('chart.html')

#@app.route('/future')

40
#def future():

# return render_template('future.html')

@app.route('/login')

def login():

return render_template('login.html')

@app.route('/upload')

def upload():

return render_template('upload.html')

@app.route('/preview',methods=["POST"])

def preview():

if request.method == 'POST':

dataset = request.files['datasetfile']

df = pd.read_csv(dataset,encoding = 'unicode_escape')

df.set_index('Id', inplace=True)

return render_template("preview.html",df_view = df)

#@app.route('/home')

#def home():

# return render_template('home.html')

41
@app.route('/prediction', methods = ['GET', 'POST'])

def prediction():

return render_template('prediction.html')

#@app.route('/upload')

#def upload_file():

# return render_template('BatchPredict.html')

@app.route('/predict',methods=['POST'])

def predict():

int_feature = [x for x in request.form.values()]

final_features = [np.array(int_feature)]

y_pred=crop.predict(final_features)

if y_pred[0] == 'Paddy IGKVR-2 (IET 19795)':

label="Crop: Paddy IGKVR-2 (IET 19795) Duration of


cultivation: 105-123"

42
elif y_pred[0] == 'Paddy CR Dhan 501 (IET 19189)':

label="Crop: Paddy CR Dhan 501 (IET 19189) Duration of


cultivation: 105-126"

elif y_pred[0] == 'Wheat VL Gehun 907 (VL 907)':

label="Crop: Wheat VL Gehun 907 (VL 907)) Duration of


cultivation: 60-154"

elif y_pred[0] == 'Wheat WHD 943':

label="Crop: Wheat WHD 943 Duration of cultivation: 60-157"

elif y_pred[0] == 'Millet Nandi-65 (MH-1549)':

label="Crop: Millet Nandi-65 (MH-1549) Duration of


cultivation: 65-70"

elif y_pred[0] == 'Lentil Pant Lentil-8(Pant L-063)':

label="Crop: Lentil Pant Lentil-8(Pant L-063) Duration of


cultivation: 45-60"

elif y_pred[0] == 'Bajra':

label="Crop: Bajra Duration of cultivation: 45-50"

elif y_pred[0] == 'Cardamom':

label="Crop: Cardamom Duration of cultivation: 730-735"

elif y_pred[0] == 'Urad':

label="Crop: Urad Duration of cultivation: 70-85"

elif y_pred[0] == 'Jowar':

label="Crop: Jowar Duration of cultivation: 65-75"

elif y_pred[0] == 'Paddy CR Dhan 401 (REETA)':

43
label="Crop: Paddy CR Dhan 401 (REETA) Duration of
cultivation: 105-124 "

elif y_pred[0] == 'Millet MH 1540 (86M64) (Hybrid)':

label="Crop: Millet MH 1540 (86M64) (Hybrid) Duration of


cultivation: 65-73"

elif y_pred[0] == 'Sugarcane Karan 5 (Co 0124)':

label="Crop: Sugarcane Karan 5 (Co 0124) Duration of


cultivation: 300-451"

elif y_pred[0] == 'Banana':

label="Crop: Banana Duration of cultivation: 365-370"

elif y_pred[0] == 'Arhar':

label="Crop: Arhar Duration of cultivation: 120-200"

elif y_pred[0] == 'Clove':

label="Crop: Clove Duration of cultivation: 120-180 "

elif y_pred[0] == 'Oilseed':

label="Crop: Oilseed Duration of cultivation: 110-115"

elif y_pred[0] == 'Tea':

label="Crop: Tea Duration of cultivation: 60-65"

elif y_pred[0] == 'Coffee':

label="Crop: Coffee Duration of cultivation: 240-270"

elif y_pred[0] == 'Turmeric':

label="Crop: Turmeric Duration of cultivation: 210-270"

elif y_pred[0] == 'Cashewnut':

44
label="Crop: Cashewnut Duration of cultivation: 1030-1035"

elif y_pred[0] == 'Ragi':

label="Crop: Ragi Duration of cultivation: 5.0-7.0"

elif y_pred[0] == 'Soyabean':

label="Crop: Soyabean Duration of cultivation: 45-65"

elif y_pred[0] == 'Black Gram':

label="Crop: Black Gram Duration of cultivation: 70-85"

elif y_pred[0] == 'Khesari':

label="Crop: Khesari Duration of cultivation: 125-130"

elif y_pred[0] == 'Wheat MACS 6222':

label="Crop: Wheat MACS 6222 Duration of cultivation:


60-151"

elif y_pred[0] == 'Black Pepper':

label="Crop: Black Pepper Duration of cultivation: 120-150"

elif y_pred[0] == 'Chillies':

label="Crop: Chillies Duration of cultivation: 40-45"

elif y_pred[0] == 'Garlic':

label="Crop: Garlic Duration of cultivation: 120-150"

elif y_pred[0] == 'Wheat MPO(JW) 1215 (MPO 1215)':

label="Crop: Wheat MPO(JW) 1215 (MPO 1215) Duration of


cultivation: 60-150"

elif y_pred[0] == 'Maize PMH 5 (JH 3110)':

45
label="Crop: Maize PMH 5 (JH 3110) Duration of cultivation:
95-105"

elif y_pred[0] == 'Groundnut Kadiri Harithandhra (K 1319)':

label="Crop: Groundnut Kadiri Harithandhra (K 1319) Duration


of cultivation: 110-121"

elif y_pred[0] == 'Groundnut GPBD 5':

label="Crop: Groundnut GPBD 5 Duration of cultivation:


110-122"

elif y_pred[0] == 'Lentil Pant Lentil-7(Pant L-024)':

label="Crop: Lentil Pant Lentil-7(Pant L-024) Duration of


cultivation: 45-61"

elif y_pred[0] == 'Tobacco':

label="Crop: Tobacco Duration of cultivation: 90-120"

elif y_pred[0] == 'Tomato':

label="Crop: Tomato Duration of cultivation: 50-60"

elif y_pred[0] == 'Cocoa':

label="Crop: Cocoa Duration of cultivation: 150-180"

elif y_pred[0] == 'Rubber':

label="Crop: Rubber Duration of cultivation: 120-130"

elif y_pred[0] == 'Masoor':

label="Crop: Masoor Duration of cultivation: 120-130"

elif y_pred[0] == 'Sunhemp':

label="Crop: Sunhemp Duration of cultivation: 60-90"

46
elif y_pred[0] == 'Varagu':

label="Crop: Varagu Duration of cultivation: 160-165"

elif y_pred[0] == 'Paddy CR Dhan 601 (IET 18558)':

label="Crop: Paddy CR Dhan 601 (IET 18558) Duration of


cultivation: 105-125"

elif y_pred[0] == 'Wheat Netravati (NIAW 1415)':

label="Crop: Wheat Netravati (NIAW 1415) Duration of


cultivation: 95-100"

elif y_pred[0] == 'Maize HSC1':

label="Crop: Maize HSC1 Duration of cultivation: 95-100"

elif y_pred[0] == 'Millet Nandi-61 (MH-1548)':

label="Crop: Millet Nandi-61 (MH-1548) Duration of


cultivation: 65-71"

elif y_pred[0] == 'Millet 86M64 (MSH 203) (Hybrid)':

label="Crop: Millet 86M64 (MSH 203) (Hybrid) Duration of


cultivation: 65-72"

elif y_pred[0] == 'Barley Pusa Losar (BH- 380)':

label="Crop: Barley Pusa Losar (BH- 380) Duration of


cultivation: 60-72"

elif y_pred[0] == 'Maize DHM 119 (BH 4062)':

label="Crop: Maize DHM 119 (BH 4062) Duration of


cultivation: 95-103"

elif y_pred[0] == 'Millet HHB 226 (MH 1479)':

47
label="Crop: Millet HHB 226 (MH 1479) Duration of
cultivation: 65-76"

elif y_pred[0] == 'Jute':

label="Crop: Jute Duration of cultivation: 120-150"

elif y_pred[0] == 'Paddy Chinsurah Rice (IET 19140)':

label="Crop: Paddy Chinsurah Rice (IET 19140) Duration of


cultivation: 105-120"

elif y_pred[0] == 'Paddy (CNI 383-5-11)':

label="Crop: Paddy (CNI 383-5-11) Duration of cultivation:


105-121"

elif y_pred[0] == 'Paddy IGKVR-1 (IET 19569)':

label="Crop: Paddy IGKVR-1 (IET 19569) Duration of


cultivation: 105-122"

elif y_pred[0] == 'Onion':

label="Crop: Onion Duration of cultivation: 80-150"

elif y_pred[0] == 'Cotton CNH012':

label="Crop: Cotton CNH012 Duration of cultivation: 80-150"

elif y_pred[0] == 'Cotton CICR-3 (CISA 614)':

label="Crop: Cotton CICR-3 (CISA 614) Duration of cultivation:


105-120"

elif y_pred[0] == 'Rice':

label="Crop: Rice Duration of cultivation: 105-120"

elif y_pred[0] == 'Flax':

48
label="Crop: Flax Duration of cultivation: 120-140"

elif y_pred[0] == 'Barley BH-902':

label="Crop: Barley BH-902 Duration of cultivation: 60-70"

elif y_pred[0] == 'Sunflower':

label="Crop: Sunflower Duration of cultivation: 90-100"

elif y_pred[0] == 'Maize HQPM-4':

label="Crop: Maize HQPM-4 Duration of cultivation: 95-101"

elif y_pred[0] == 'Groundnut Girnar - 3 (PBS 12160)':

label="Crop: Groundnut Girnar - 3 (PBS 12160) Duration of


cultivation: 175-180"

elif y_pred[0] == 'Dry Ginger':

label="Crop: Dry Ginger Duration of cultivation: 175-180"

elif y_pred[0] == 'Horse Gram':

label="Crop: Horse Gram Duration of cultivation: 120-180"

elif y_pred[0] == 'Castor Seed':

label="Crop: Castor Seed Duration of cultivation: 7.0-10"

elif y_pred[0] == 'Sesame':

label="Crop: Sesame Duration of cultivation: 40-45"

elif y_pred[0] == 'Sugarcane Karan 6 (Co 0239)':

label="Crop: Sugarcane Karan 6 (Co 0239) Duration of


cultivation: 300-450"

elif y_pred[0] == 'Peas':

49
label="Crop: Peas Duration of cultivation: 50-100"

elif y_pred[0] == 'Paddy RC Maniphou 11 (IET 20193)':

label="Crop: Paddy RC Maniphou 11 (IET 20193) Duration of


cultivation: 105-127"

elif y_pred[0] == 'Cowpea':

label="Crop: Cowpea Duration of cultivation: 45-90"

elif y_pred[0] == 'Maize MCH 36 (Hybrid) (DKC 9099)':

label="Crop: Maize MCH 36 (Hybrid) (DKC 9099) Duration of


cultivation: 95-102"

elif y_pred[0] == 'Pulses':

label="Crop: Pulses Duration of cultivation: 95-102"

elif y_pred[0] == 'Sugarcane Co-0218':

label="Crop: Sugarcane Co-0218 Duration of cultivation:


300-452"

elif y_pred[0] == 'Wheat PDW 314':

label="Crop: Wheat PDW 314 Duration of cultivation: 60-152"

elif y_pred[0] == 'Sweet potato':

label="Crop: Sweet potato Duration of cultivation: 120-125"

elif y_pred[0] == 'Cotton VBCH 2231':

label="Crop: Cotton VBCH 2231 Duration of cultivation:


150-180"

50
return render_template('prediction.html', prediction_text=label)

#@app.route('/performance')

#def performance():

return render_template('performance.html')

if __name__ == "__main__":

app.run(debug=True)

51

You might also like