0% found this document useful (0 votes)
396 views113 pages

Crop Report

This document is a project report submitted for the partial fulfillment of a Bachelor of Engineering degree. It discusses a project on crop yield prediction for crops like rice, ragi, and sugarcane in Mysore region, India. Multiple linear regression machine learning algorithm is used to predict crop yields based on historical data of dependent factors like rainfall, temperature, and location from 1997-2014. The results show prediction accuracies of 91% for seasonal crops and 72% for yearly crops.

Uploaded by

Saurabh Kumar
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)
396 views113 pages

Crop Report

This document is a project report submitted for the partial fulfillment of a Bachelor of Engineering degree. It discusses a project on crop yield prediction for crops like rice, ragi, and sugarcane in Mysore region, India. Multiple linear regression machine learning algorithm is used to predict crop yields based on historical data of dependent factors like rainfall, temperature, and location from 1997-2014. The results show prediction accuracies of 91% for seasonal crops and 72% for yearly crops.

Uploaded by

Saurabh Kumar
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/ 113

DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING

A PROJECT REPORT
ON
“CROP YIELD PREDICTION”

Submitted in the partial fulfillment of the requirements in the 8th semester of

BACHELOR OF ENGINEERING IN

INFORMATION SCIENCE AND ENGINEERING

By

VIJAY HEGDE S
1NH16IS121
YASHVANTH C V
1NH16IS126
S CHANDRA KIRAN
1NH16IS026

Under the guidance of


Mrs. SHOBHA SHANMUGHAM
Sr.Assistant Professor, Dept. of ISE, NHCE

DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING


NEW HORIZON COLLEGE OF ENGINEERING
(Autonomous College Permanently Affiliated to VTU, Approved by AICTE,
Accredited by NAAC with ‘A’ Grade)
Ring Road, Bellandur Post, Near Marathalli,
Bangalore-560103, INDIA
DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING

Certified that the project work entitled “Crop Yield Prediction”, carried out by Mr.
Vijay Hegde S, 1NH15IS121, Mr. Yashvanth C V, 1NH16IS126, Mr. S Chandra Kiran,
1NH15IS026 bonafide students of NEW HORIZON COLLEGE OF ENGINEERING,
Bengaluru, in partial fulfillment for the award of Bachelor of Engineering in Information
Science and Engineering of the Visveswaraiah Technological University, Belgaum during the
year 2018-19. It is certified that all corrections/suggestions indicated for Internal Assessment
have been incorporated in the Report deposited in the departmental library.

The project report has been approved as it satisfies the academic requirements in respect of
Project work prescribed for the said Degree.

Name & Signature of the Guide Name Signature of the HOD Signature of the Principal
Mrs. Shobha Shanmugham Dr. R J Anandhi Dr. Manjunatha

External Viva

Name of the Examiners Signature with Date

1.

2.
DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING

DECLARATION

We hereby declare that we have followed the guidelines provided by the Institution in
preparing the project report and presented report of project titled “CROP YIELD
PREDICTION”, and is uniquely prepared by us after the completion of the project
work. We also confirm that the report is only prepared for my academic requirement and
the results embodied in this report have not been submitted to any other University or
Institution for the award of any degree.

Signature of the Students

Name: Vijay Hegde S Name: Yashvanth C V Name: S Chandra Kiran


USN: 1NH16IS121 USN: 1NH16IS126 USN: 1NH16IS026
ABSTRACT

India is an agricultural country. Yield of each crop depends on its dependent factors. It is very
important to predict the yield of a crop to help farmers. Crop Yield Prediction is predicting the yield
of a crop in future based on the dependent factors. Crop yield is dependent on factors like rainfall,
pressure, temperature and area or the geographical location. Prediction is done using machine
learning algorithms using historical data of dependent factors.

In Crop Yield Prediction, we have chosen Mysore region for the prediction of crops like Rice, Ragi
and Sugarcane. Using the rainfall, pressure, temperature data from 1997-2014 of Mysore region crop
yield is predicted. To predict the yield one of the machine learning algorithm called Multiple Linear
Regression algorithm is used. The result of prediction is plotted via graph with actual and predicted
values. Our models gave accuracy of 91% for the seasonal crop and the 72% accuracy for the yearly
crop.

Crop Yield Prediction helps farmers to grow a crop which gives more yields based on the
algorithmic prediction. Thus it helps to reduce loss for the farmers. Prediction also helps to increase
the national economy.

i
ACKNOWLEDGEMENT

Any achievement, be it scholastic or otherwise does not depend solely on the individual efforts
but on the guidance, encouragement and cooperation of intellectuals, elders and friends. A
number of personalities, in their own capacities have helped me in carrying out this project. We
would like to take an opportunity to thank them all.

First and foremost we thank the management, Dr. Mohan Manghnani, Chairman, New Horizon
Educational Institutions for providing us the necessary state of art infrastructure to do Project.

We would like to thank Dr.Manjunatha, Principal, New Horizon College of Engineering,


Bengaluru, for his valuable suggestions and expert advice.

We would like to thank Dr. R J Anandhi, Professor and Head of the Department, Information
Science and Engineering, New Horizon College of Engineering, Bengaluru, for constant
encouragement and support extended towards completing my Project.

We deeply express our sincere gratitude to our guide Mrs. Shobha Shanmugham, Sr. Assistant
Professor, Department of ISE, New Horizon College of Engineering, Bengaluru, for her able
guidance, regular source of encouragement and assistance throughout our project period.

Last, but not the least, we would like to thank our peers and friends who provided me with
valuable suggestions to improve my project.

VIJAY HEGDE S (1NH16IS121)


YASHVANTH C V (1NH16IS126)
S CHANDRA KIRAN (1NH16IS026)

ii
TABLE OF CONTENTS

SERIAL NO CONTENTS PAGE


NO
1 Preamble 1

1.1 Introduction 1

1.2 Relevance of the project 3

1.3 Purpose 4

1.4 Scope of the project 4

1.5 Problem statement 4

1.6 Problem explanation 5

1.7 Objective of the project 5

1.8 Existing system 6

1.9 Proposed system 6

1.9.1 Advantages 6

2 Literature survey 7

2.1.1 Introduction 8

2.1.2 Data mining techniques 9

2.1.3 K – Nearest 9
2.1.4 Artificial neural network 10

2.1.5 Clustering 11

2.1.6 Conclusion 12

2.2.1 Introduction 13

iii
2.2.2 Literature review 14

2.2.3 Proposed approach 15

2.2.4 Methods and materials 15

2.2.4.1 Linear regression 15

2.2.4.2 Logistic regression 16

2.2.4.3 Ridge regression 16

2.2.5 Dataset description 17

2.2.6 Result and analysis 17

2.2.7 Conclusion 18

3 System requirement specification 19

3.1 Functional requirements 19

3.2 Non functional requirements 20

3.2.1 Product requirements 22

3.2.2 Organizational requirements 22

3.2.3 User requirements 23

3.2.4 Basic operational requirements 23

3.3 Hardware requirements 24

3.4 Software requirements 25


3.5 Theoretical background 25

3.5.1 Machine learning 25

3.5.2 Crop yield prediction models 27

3.5.3 Support vector machines 27

3.6 Language specification 28

3.6.1 Laravel Framework 29

3.6.2 Bootstrap 31

3.6.3 AngularJS 31

iv
3.6.4 PHP 32

3.6.5 HTML 33

3.6.6 CSS 33

3.6.7 Multiple linear regression 33

3.6.8 Python API 34

4 System design and analysis 36

4.1 Overview of the system design 36

4.1.1 Preliminary design 36

4.1.2 System development methodology 36

4.1.3 Model phases 37

4.1.4 Reason for choosing agile model 38

4.1.5 Design using UML 39

4.1.6 Architectural design 40

4.1.7 Flowchart 40

4.1.8 Use case diagram 41

4.1.8.1 Activity diagram 42

4.1.8.2 Sequence diagram 43

4.2 Overview of system analysis 43


4.2.1 Feasibility study 43

4.2.1.1 Performance analysis 44

4.2.1.2 Technical analysis 44

4.2.1.3 Economic analysis 45

5 Implementation 50

5.1 Python code for predicted graph 50

v
5.2 PHP code 53
6 Testing 75
6.1 Functional testing 76
6.2 Non functional testing 76
6.3 Testing methodologies 77
6.3.1 White box testing 77
6.3.2 Black box testing 78
6.4 Testing levels 79
6.4.1 Unit testing 80
6.4.2 Integration testing 80
6.4.3 System testing 81
6.5 Quality assurance 84
6.5.1 Quality factors 86
7 Experimental results 89
8 Conclusion and future scope 90
8.1 Conclusion 90
8.2 Future scope 90
Reference 91
Snapshots 92

vi
LIST OF FIGURES

Figure no Figure Name Page no


1.1 Rice 2

1.2 SugarCane 2

1.3 Ragi 3

2.1 Area in hectare VS crop 18

3.1 SVM Flowchart 28

4.1 Agile Model 37


4.2 Architecture 40

4.3 Flowchart 40

4.4 Shows the user case diagram 42

4.5 UML Notations-1 46

4.6 UML Notations-2 47

4.7 Sequence Diagram for Login Page 48

4.8 Sequence Diagram for Sign Up Page 48

4.9 Sequence Diagram for Datasets 49

4.10 Sequence Diagram for Update Profile Page 49

6.1 Different levels of testing 79

A.1 Sign Up Page 92

A.2 Login Page 92

A.3 Profile Update Page 93

A.4 Datasets 93

A.5 Rice 94

A.6 Sugarcane 94

A.7 Ragi 95
A.8 About Page 95

vii
LIST OF TABLES

Table no Table Name Page no


6.1 Test case for login credential 82

6.2 Test case for Sign up credential 82

6.3 Test case for Update Profile Details 83

6.4 Test case for Logout 83

6.5 Test case for Datasets Display 83

6.6 Test case for Prediction Result Graph 84

viii
CROP YIELD PREDICTION

Chapter 1

PREAMBLE

1.1 Introduction

Agriculture is one of the main sectors to be impacted by different sources like climatic changes,
soil attributes, seasonal changes etc., Crop yield prediction [1] is based on various kinds of data
collected and extracted by using data mining techniques [2] such as machine learning techniques
[3] different sources which are useful for growth of the crop. It is an art of forecasting crop and
the quantity of yield in advance i.e., before the harvest actually takes place. Predicting the crop
yield can be extremely useful for farmers. If they have an idea of the amount of yield they can
expect, they can contract their crop prior to harvest, often securing a more competitive price
than if they were to wait until after harvest. The involvement of experts in prediction of crop yield
leads to issues like lack of knowledge about natural events, negation of personal perception and
fatigue etc. such issues can be to overcome by using the models and decision tools for crop yield
prediction. Likewise, industry can benefit from yield predictions by better planning the logistics
of their business.

In India, average food consumption at present is 550 sq per capita per day. With the growing
population, the imminent challenge is to increase food production in order to feed the population
that will reach 1.50 Billion by the year 2022. Farmers will have to produce 50 percent of more
grains to meet the current growing demand. The following are the atmospheric weather
variables which influences the crop production.

• Precipitation

• Temperature

• Atmospheric pressure

Dept of ISE, NHCE Page 1


CROP YIELD PREDICTION

Figure 1.1: Rice

Figure 1.2: Sugarcane

Rainfall one of the most important factor influences the vegetation of a place. Temperature is a
measure of intensity of heat energy. The range of temperature for maximum growth of most of
the agricultural plants is between 15 and 40c.

Achieving maximum crop yield at minimum cost is one of the goals of agricultural production.
Early detection and management of problems associated with crop yield indicators can help
increases yield and subsequent profit. Predictions could be used by crop managers to minimize
losses when unfavorable conditions may occur. Additionally, these predictions could be used to
maximize crop prediction when potential exists for favorable growing conditions.

Dept of ISE, NHCE Page 2


CROP YIELD PREDICTION

The crop yield prediction comprises of mostly all essential parameters that are needed for the
better yield of crop. This enhances the classification results of the crop yield. In general, one of
the difficulties faced in the prediction process is that most of the essential parameters that are
necessary to consider for the accurate prediction are not consider. It reduces the efficiency of
the predicted results which in turn leads to lack of proper forecasting of the crop yield. It is also
more complex to predict the optimized number of input parameters that are to be considered in
the prediction process.

Figure 1.3: Ragi

1.2 Relevance of the project

This project is based on the curbing the problem faced by the farmers as well as providing the
accurate level of the harvest they can expect from the crop they have growth depending on the
dependent factors like temperature, rainfall, etc. This project is mainly developed to help
farmers so that this may help them in analysis of the harvest of the crop. Farmers are facing
loses in the crop yield due improper knowledge of the crop and the natural factor that are
effecting them. In this project we analysis the factors and predict a graph that shows the crop’s
yield well before the harvest.

Dept of ISE, NHCE Page 3


CROP YIELD PREDICTION

1.3 Purpose

It is been observed that farmers are facing the problem at the time of the yield of the crop
because of the rapid changes in the weather where it effect the yield of the crop. Decrease the
quality of the crop and which in turn provide less income to the farmers. This project works on
achieving the more quality of the crop that will help the farmers to gain more money. In this
project we have collected the datasets of all the factors that are depends of the crops of several
years. Using this data the prediction is obtained to show that the harvest of the crop that is
growth in that region.

1.4 Scope of the project

In the project, we introduce a scalable, accurate, and inexpensive method to predict crop yield
using available climatic data and machine learning. Our machine learning approach can predict
the crop yield with high spatial resolution (for particular regional). We have collected
temperature, rainfall, crop yield and other datasets for Mysore district from various sources like
Indian Methodological Department, KSNDMC websites and agriculture department. Machine
learning algorithms like multi-linear regression algorithm, clustering algorithm, SVM algorithm
to predict crop yield based on factors like temperature, rainfall, and pressure. Using AngularJS,
Laveral framework, MySQL database user interfaces and backend are designed. The user
interface gets the result of the various crop yield graph and displays it to the user.

1.5 Problem Statement

India is an agricultural country. Yield of each crop depends on its dependent factors. It is very
important to predict the yield of a crop to help farmers. Crop Yield Prediction is predicting the
yield of a crop in future based on the dependent factors. Crop yield is dependent on factors like
rainfall, pressure, temperature and area or the geographical location. This is achieved by

Dept of ISE, NHCE Page 4


CROP YIELD PREDICTION

(a) Designing a system to predict crop yield.

(b) Providing graphical user interface to view prediction result and historical datasets.

1.6 Problem explanation

India is an agricultural country. Yield of each crop depends on its dependent factors. It is very
important to predict the yield of a crop to help farmers. Crop Yield Prediction is predicting the
yield of a crop in future based on the dependent factors. Crop yield is dependent on factors like
rainfall, pressure, temperature and area or the geographical location. Prediction is done using
machine learning algorithms using historical data of dependent factors.

In Crop Yield Prediction, we have chosen Mysore region for the prediction of crops like Rice, Ragi
and Sugarcane. Using the rainfall, pressure, temperature data from 1997-2014 of Mysore region
crop yield is predicted. To predict the yield one of the machine learning algorithm called Multiple
Linear Regression algorithm is used. The result of prediction is plotted via graph with actual and
predicted values. Our models gave accuracy of 91% for the seasonal crop and the 72% accuracy
for the yearly crop.

Crop Yield Prediction helps farmers to grow a crop which gives more yields based on the
algorithmic prediction. Thus it helps to reduce loss for the farmers. Prediction also helps to
increase the national economy.

1.7 Objective of the Project

In the project, we introduce a scalable, accurate, and inexpensive method to predict crop yield
using available climatic data and machine learning. Our machine learning approach can predict
the crop yield with high spatial resolution (for particular regional).

Dept of ISE, NHCE Page 5


CROP YIELD PREDICTION

1.8 Existing system

Other than blogging websites which provide information about the agriculture and agricultural
accessories, there is no particular website for predicting the yield of the crop depending on the
history in that specific geographical region.

1.9 Proposed System

We have collected temperature, rainfall, crop yield and other datasets for Mysore district from
various sources like Indian Methodological Department, KSNDMC websites and agriculture
department. Machine learning algorithms like multi-linear regression algorithm, clustering
algorithm, SVM algorithm to predict crop yield based on factors like temperature, rainfall, and
pressure. Using AngularJS, Laveral framework, MySQL database user interfaces and backend are
designed. The user interface gets the result of the various crop yield graph and displays it to the
user.

1.9.1 Advantages

 As the people us this application the dataset can be stored of that particular region.

 Data stored can help the other farmer’s in future to check the harvest of the crop
well before the yield.

 Adding more data the prediction will be even more accurate.

Dept of ISE, NHCE Page 6


CROP YIELD PREDICTION

Chapter 2

LITERATURE SURVEY
Case 1: A Survey on Agriculture Analysis for Crop Yield Prediction Using Data Mining
Techniques by Dr.A.Senthil Kumar, P.Arun Assistant Professor, Dept of CS, Sankara College of
Science and Commerce M.Phil., Part-Time Research Scholar, Sankara College Of Science And
Commerce

Abstract:
Now-a-day's agriculture is one of the most important field in the emerging real world and it is
the main occupation and backbone of our country. Agriculture is in poor condition since before
comparing previous years. The main reasons for this is without a well formed pattern about
farming and proper guidance to the farmers. Due to these problems, farming affects the yield
of crop and unawareness about the crop cultivation methodologies. And also season to
cultivate the crop and choosing which soil is the best to cultivate the particular crop based on
the weather condition and also when to harvest the crop for the best yield. If the farmer is
aware about the crop cultivation methodologies and harvesting it will more helpful for the
people in the real world and also to maximize the crop productivity. Data mining is the process
of finding new template from large data sets, this technology which is employed in inferring
useful knowledge that can be put to use from a vast amount of data, various data mining
techniques such as classification, prediction, clustering and outlier analysis can be used for the
purpose. Climate is one of the meteorological data that is rich by important knowledge. This
paper presents a brief comparative study of various papers that deal with various techniques
used to figure out the crop yield. Different data mining techniques that are in use for the crop
yield estimation are K-Means, K-Nearest neighbor (KNN), Artificial Neural Networks(ANN).
Recently data processing techniques in agriculture required decide, storage, monitored and
retrieval the resources used. This survey aims to search out appropriate data processing models
to realize high accuracy and prediction capabilities.

Dept of ISE, NHCE Page 7


CROP YIELD PREDICTION

2.1.1 Introduction

Agriculture is the backbone of the Indian economy. The productivity of agriculture is very low.
So as the demand of food is increasing, the researchers, farmers, agricultural scientists and
government are trying to put extra effort and techniques for more production. Data mining can
be used for predicting the future trends of agricultural processes. Data mining is the process to
discover interesting knowledge from large amounts of data. Data mining is the process that
results in the discovery of new patterns in large data sets. The goal of the data mining process is
to extract knowledge from an existing data set and transform it into a human understandable
formation for advance use. It is the process of analyzing data from different perspectives and
summarizing it into useful information. There is no restriction to the type of data that can be
analyzed by data mining. We can analyze data contained in a relational database, a data
warehouse, a web server log or a simple text file. Analysis of data in effective way requires
understanding of appropriate techniques of data mining. The intention of this paper is to give
details about different data mining techniques in perspective of agriculture domain so
researchers can get details about appropriate data mining technique in context to their work
area. Data mining tasks can be classified into two categories: Descriptive data mining and
Predictive data mining.. Descriptive data mining tasks characterize the general properties of the
data in the database while predictive data mining is used to predict explicit values based on
patterns determined from known results. Prediction involves using some variables or fields in
the database to predict unknown or future values of other variables of interest. As far as data
mining technique is concern; in the most of cases predictive data mining approach is used.
Predictive data mining technique is used to predict future crop, weather forecasting, pesticides
and fertilizers to be used, revenue to be generated and so on.

Dept of ISE, NHCE Page 8


CROP YIELD PREDICTION

2.1.2 Data Mining Techniques

In this paper we have used the data mining techniques include Classification and Clustering to
predict the exact pattern for the best crop yield prediction. With the help of these data mining
techniques farmers can grow the crop yield.
Classification Classification and prediction are two forms of data analysis that can be used to
extract models describing important data classes or to predict future data trends. It is a process
in which a model learns to predict a class label from a set of training data which can then be
used to predict discrete class labels on new samples. To maximize the predictive accuracy
obtained by the classification model when classifying examples in the test set unseen during
training is one of the major goals of classification algorithm. Data mining classification
algorithms can follow three different learning approaches: supervised learning, unsupervised
learning, or semi-supervised learning. The different classification techniques for discovering
knowledge are Rule Based Classifiers, Bayesian Networks(BN), Decision Tree (DT), Nearest
Neighbour(NN), Artificial Neural Network(ANN), Support Vector Machine (SVM), Rough Sets,
Fuzzy Logic, Genetic Algorithms.

2.1.3 K-Nearest

Neighbor The k-Nearest neighborhood methodology is wide used adopted thanks to its
potency. The key plan of the algorithmic rule is to categorize a brand new sample within the
most frequent class of its nearest neighbors within the coaching set. This is often the foremost
selection formula on the category labels of its neighbors. The k-nearest neighbor classification
algorithmic rule may be divided into 2 phases: coaching section and testing section. Bermejo
associated Cabestany urged a reconciling learning algorithmic rule to permit fewer information
points to be utilized in coaching information set. Several different techniques are projected to
scale back procedure burden of k-nearest neighbor algorithms.

Dept of ISE, NHCE Page 9


CROP YIELD PREDICTION

2.1.4 Artificial Neural Network(ANN)

Artificial neural network is one of the new data mining techniques that are based on biological
neural processes of human brain. According to this technique once the neural network is
trained it can predict the crop yield in similar patterns even if the past data include some errors.
Even if the data is complex, multivariate, nonlinear this network gives the accurate results and
also without any of underlying principles the relationship between them the output is
extracted. Artificial Neural Networks (ANN) networks during which every node represents a
somatic cell and every link represents the method 2 somatic cell act. Every somatic cell
performs straightforward tasks, whereas the network representing of the work of all its
neurons is ready to perform the additional complicated tasks. A neural network is associate
interconnected set of input/output units wherever every association includes a weight related
to its. The process of classification by ANN may be broadly speaking outlined as follows:

 Run a sample from the coaching set, by giving its attribute values as input.

 The summation of weights and activation functions area unit applied at every

 Node of hidden and output layers, till the output is generated.

 Compare output with the expected output from coaching set.

 If output doesn't match, return layer to layer and modify area unit weights and

 Biases of nodes.

 Run consecutive sample and method a similar.

 Eventually the weights can coverage and method stops.

Dept of ISE, NHCE Page 10


CROP YIELD PREDICTION

2.1.5 Clustering

The process of grouping a set of physical or abstract object into classes of similar objects is
called clustering. Clustering is unsupervised technique used to group similar instances on the
basis of feature. It has no labels required. Clustering does not require training data. Each cluster
that is form can be viewed as a class of object, form which rule can be derived The different
clustering methods are Hierarchical Methods(HM), Partitioning Methods (PM), Density-based
Methods(DBM), Model-based Cluster Methods(MBCM), Grid-based Methods and Soft-
computing Methods [fuzzy, neural network based], Squared Error-Based Clustering (Vector
Quantization), network data and Clustering graph. 2.4.1 K-Means Approach The most important
clustering technique is K-Means clustering. This technique is used to classify the data which
have no previous knowledge about the data or the training set. The parameter K denotes the
amount of clusters required to partition the data. The idea of this clustering technique is, given
K number of clusters we can define K centers, one for each cluster based on all samples
belonging to a cluster. These centers must be placed far away from each other and then
associate each sample to the cluster that has the closest centroid. When no samples are left,
the process of finding new K centers and assigning samples to the clusters that has the closest
centroid is iteratively carried out until no longer the samples can change their clusters. In the
research article, the researcher states that using this K-Means approach the Government could
help the agricultural firms to increase one of their production practices such as acquiring new
farmers by framing new profitable agriculture schemes based on crop yield prediction and
eventually campaigning to different groups of farmers about a particular scheme based on the
result of the grouping of various crops depending on common features.

Dept of ISE, NHCE Page 11


CROP YIELD PREDICTION

2.1.6 Conclusion

Agriculture is the most important application area particularly in the developing countries like
India. Use of information technology in agriculture can change the scenario of decision making
and farmers can yield in better way. For decision making on several issues related to agriculture
field; data mining plays a vital role. In this paper we have discussed about the role of data
mining in perspective of agriculture field. We have also discussed several data mining
techniques and their related work by several authors in context to agriculture domain. This
paper also focuses on different data mining applications in solving the different agricultural
problems. This paper integrates the work of various authors in one place so it is useful for
researchers to get information of current scenario of data mining techniques and applications
in context to agriculture field.

Dept of ISE, NHCE Page 12


CROP YIELD PREDICTION

Case 2: CROP YIELD PREDICTION IN AGRICULTURE USING DATA MINING PREDICTIVE

ANALYTIC TECHNIQUES by P.Surya, Dr. I.Laurence Aroquiaraj, Ph.D Research Scholar,

Assistant Professor Department of Computer Science ,Periyar University, Salem, Tamilnadu,

India

Abstract:
Data Mining is emerging research field in Agriculture especially in crop yield analysis and
prediction. As early into the growing season as possible, a farmer is focused in perceptive how
much yield they about to expect. As with many other sectors the amount of agriculture data are
increasing on a daily source. In our proposed work, collected agriculture dataset will be used to
get crop yield prediction model using various regression techniques. Regression analysis was
tested for the effective prediction or forecast of the agriculture yield for various crops in
Tamilnadu state particularly in North Western zone of Tamilnadu. North western zone of
tamilnadu state data consist four districts. The North western zone of Tamilnadu districts are
Dharmapuri, Salem, Namakkal, Krishnagiri. By the analysis depends on the results of predictor
model, in the north western zone, under the area having more cultivated crops are Tapiaco,
Sugar cane, Ragi, Maize, Groundnut.

2.2.1 Introduction
Agriculture is the main stay of the State economy in that its role is fundamentally instrumental
in terms of market, aspect and product contributions. India’s economy mainly depends on
agriculture yield growth and their related agro industry. Area under agriculture comes to 61 per
cent of the total geographical area of Tamil Nadu. Performance of agricultural sector mainly
hinges on natural forces such as spatio-temporal distribution of rainfall, temperature, climate
etc., with the result any deviation of monsoon from the normal pattern brings about enormous
fluctuations in area and production. Crop yield has a direct impact on National and
International economies annually and the yield predicted plays a significant part in the food

Dept of ISE, NHCE Page 13


CROP YIELD PREDICTION

management and agriculture sector. Researchers have proposed statistical model based on
time series data like agro- climatic weather variables, Agriculture crop yield that could suggest
forecasting process for harvest. Predictive modeling is a method that uses data mining and
probability to forecast outcomes. Data Modeling for Prediction involves four stages namely
historical data analysis (Descriptive), Data preprocessing, modeling of Data and Performance
Estimation. In Data mining, a Classification technique gives a best solution for prediction
process. Regression analysis, it observes the relation between a independent (predictor) and
dependent (target) variables. This technique helps to estimate through time series data and
finds the underlying effect among these variables.

2.2.2 Literature review


This section discuss about various related works already done in data mining techniques using
agriculture dataset. Most of the researchers focused on the problem for yield prediction. D
Ramesh , B Vishnu Vardhan, researchers reviewed the Data mining techniques and found out
that there are several algorithms and techniques being applied in agricultural domain
particularly for yield prediction based on Rainfall dataset. Multiple Linear Regression (MLR) is
the method used to model the linear relationship between a dependent variable and one or
more independent variable]. Researchers focused on Yield prediction based on Rainfall dataset,
results comparison between MLR Technique and K-Means algorithm. Jyotshna Solanki, Prof.
(Dr.) Yusuf Mulge, observed the research studies on different data mining techniques in the
field of agriculture. Data mining techniques are used in agriculture for prediction of problem,
disease detection, optimizing the pesticide and so on. Data mining techniques are used for
disease detection, pattern recognition by using multiple applications. Data mining is close to
determine the similarities between searching the precious business information from the
massive information systems such as finding linked products in gigabytes of store scanner data
or the mining a mountain for a vein of important dataset.

Dept of ISE, NHCE Page 14


CROP YIELD PREDICTION

2.2.3 Proposed approach


In the proposed method, initially the raw data set was collected and it is subjected to
preprocess for noise removing (replacement of missing values) and computational methods.
From that dataset, it is subjected to Feature selection for make a predictive modeling. In this
proposed approach it is mainly focused on Regression Techniques. Various regression analysis
should be performed and it was compared and tested. Regression analysis is a form of
predictive modeling technique which investigates the association between a dependent (target)
and independent variable(s) (predictor). This technique is used for forecasting, time series
modeling and discovers the causal effect relationship between the variables. Regression
analysis indicates the significant relationships between dependent variable and independent
variable and it indicates the strength of impact of multiple independent variables on a
dependent variable. These techniques are typically motivated by 3 metrics. They are number of
independent variables, type of dependent variables and regression line pattern shape.

2.2.4 Methods and materials

2.2.4.1 Linear Regression

Linear Regression is one of the commonly used well-known modeling techniques in data mining
concept, in which the dependent variable is to be taken as continuous, in other independent
variables will be continuous or discrete, and regression line is linear [14]. Here to find the
relationship two variable, one is dependent variable (Y) and other one variable that is
independent (X) with best fit straight line is commonly called as regression line. The regression
equation is shown in below,

Y=a + b*X + e ------ (1)

In (1) where ‘e’ is error term, ‘b’ is line slope and ‘a’ is intercept. This (1) equation can be used
to predict the value of target variable based on given predictor variable(s). Linear Regression is
very perceptive toward Outliers. It can terribly affect the regression line and forecasted values.

Dept of ISE, NHCE Page 15


CROP YIELD PREDICTION

2.2.4.2 Logistic Regression

Logistic regression technique is used to find the probability of event of Success and event of
Failure. Logistic regression will be used when the dependent variable is binary (0/ 1, True/
False, Yes/ No) in nature. Here the value of Y ranges from 0 to 1 and it can be represent by this
equation (2), (3),

Odds = p / (1-p) = probability (p) of event occurrence/ probability (p) of no event occurrence

ln(odds) = ln(p/(1-p)) --------(2)

logit(p)=ln(p1/(1-p)) = b0+b1X1+b2X2+b3X3....+bkXk -------------- (3)

2.2.4.3 Ridge regression

Ridge Regression could be a technique used once the data suffers from multi co-linearity
(independent variables are extremely correlated). In multi co-linearity, even though the least
squares estimate (OLS) are unbiased and variances are large, deviates the true value far by the
observed value. In the regression estimates, by adding a degree of bias, ridge regression
reduces the standard errors [14]. Equation of the linear regression is represented as

Y = a + b*X ----- (5)

Hence the equation included by an error term looks like:

Y=a + b*X + e ------- (6)

Where ‘e’ denotes an error term. Error term is the value required to correct for a prediction
error between the observed and predicted value.

y = (a + y) = a + b1x11+ b2x22 +....+ e1 --- (7)

for multiple independent variables equation (7) works out.

Dept of ISE, NHCE Page 16


CROP YIELD PREDICTION

2.2.5 Dataset description


The dataset was collected from website of agricultural government portal. It contains state
wise, district wise, crop wise, season wise and year wise data on crop covered area and
production of crop yield in India. In this dataset, the attributes of Area is measured in hectares
and Crop production is measured in tones per hectare.

2.2.6 Results and analysis


The result and analysis was done under the data refers to Tamilnadu state particularly focused
on North Western zone of Tamilnadu. North western zone of tamilnadu state data refers to the
district of Dharmapuri, Salem, Namakkal, Krishnagiri. It contains crop wise, season wise and
year wise data on crop covered area and production. Area is measured in hectares and Crop
production is measured in tones per hectare. Linear regression predictor model for two
attributes is given below

In (production in tons ~ Area in hectares + Crop, dataframe) ------(8)

As this (8) it will predict the Production in Tons, when those values are assigned for Area in
hectares and Crop

Linear regression predictor model for three attributes is given below

In (production in tons ~ Area in hectares + Crop+Year, dataframe) ------(9)

As this equation (9) it will predict the Production in Tons, when those values are assigned for
Area in hectares, Crop and Year

Dept of ISE, NHCE Page 17


CROP YIELD PREDICTION

Fig 2.1 area in hectare VS crop

Area in hectares vs crop in which crops was taken along y-axis and area in hectare was taken
along x-axis. In the north western zone, under the area having more cultivated crops are
Tapiaco, Sugar cane, Ragi, Maize, Groundnut.

2.2.7 Conclusion
This paper dealt with various regression techniques for agriculture crop yield prediction. Our
proposed work mainly focused on to get predictor model by using regression techniques.
Predictor formula is most useful in the crop prediction of Agriculture crop Production in Tons.
Highest rate of yield production in tamilnadu state particularly in North Western zone is
sugarcane and tapioca. Banana, Maize, Ragi, Turmeric, Coconut, Cotton, Jowar are having next
highest yield of production rate compared to the other crops depends on the results of
predictor model.

Dept of ISE, NHCE Page 18


CROP YIELD PREDICTION

Chapter 3

SYSTEM REQUIREMENT SPECIFICATION

Software requirement Specification is a fundamental document, which forms the foundation of


the software development process. It not only lists the requirements of a system but also has
a description of its major feature. An SRS is basically an organization’s understanding (in
writing) of a customer or potential client’s system requirements and dependencies at a
particular point in time (usually) prior to any actual design or development work. It’s a two-way
insurance policy that assures that both the client and the organization understand the other’s
requirements from that perspective at a given point in time.

The SRS also functions as a blueprint for completing a project with as little cost growth as
possible. The SRS is often referred to as the ”parent” document because all subsequent project
management documents, such as design specifications, statements of work, software
architecture specifications, testing and validation plans, and documentation plans, are related
to it. It is important to note that an SRS contains functional and nonfunctional requirements
only; it doesn’t offer design suggestions, possible solutions to technology or business issues, or
any other information other than what the development team understands the customer’s
system requirements to be.

3.1 Functional Requirement

Functional Requirement defines a function of a software system and how the system must
behave when presented with specific inputs or conditions. These may include calculations, data
manipulation and processing and other specific functionality. In this system following are the
functional requirements:-

Dept of ISE, NHCE Page 19


CROP YIELD PREDICTION

• Input test case must not have compilation and runtime errors.

• The application must not stop working when kept running for even a long time.

• The application must function as expected for every set of test cases provided.

• The application should generate the output for given input test case and input
parameters.

• The application should generate on-demand services.

3.2 Non-Functional Requirement

Non-functional requirements are the requirements which are not directly concerned with the
specific function delivered by the system. They specify the criteria that can be used to judge the
operation of a system rather than specific behaviors. They may relate to emergent system
properties such as reliability, response time and store occupancy. Non-functional requirements
arise through the user needs, because of budget constraints, organizational policies, the need
for interoperability with other software and hardware systems or because of external factors
such as:-

 Product Requirements

 Organizational Requirements

 User Requirements

 Basic Operational Requirements

Dept of ISE, NHCE Page 20


CROP YIELD PREDICTION

In systems engineering and requirements engineering, a non-functional requirement is a


requirement that specifies criteria that can be used to judge the operation of a system, rather
than specific behaviors. This should be contrasted with functional requirements that define
specific behavior or functions. The plan for implementing non-functional requirements is
detailed in the system architecture. Broadly, functional requirements define what a system is
supposed to do and non- functional requirements define how a system is supposed to be.

Functional requirements are usually in the form of system shall do requirement, an individual
action of part of the system, perhaps explicitly in the sense of a mathematical function, a black
box description input, output, process and control functional model or IPO Model. In contrast,
non-functional requirements are in the form of system shall be requirement, an overall
property of the system as a whole or of a particular aspect and not a specific function. The
systems’ overall properties commonly mark the difference between whether the development
project has succeeded or failed.

Non-functional requirements of our project include:

 Response time - The time the system takes to load and the time for responses on
any action the user does.
 Processing time - How long is acceptable to perform key functions or export / import
data?
 Throughput The number of transactions the system needs to handle must be kept in
mind.
 Storage - The amount of data to be stored for the system to function.
 Growth Requirements - as the system grows it will need more storage space to keep
up with the efficiency.
 Locations of operation - Geographic location, connection requirements and the
restrictions of a local network prevail.
 Architectural Standards - The standards needed for the system to work and sustain.

Dept of ISE, NHCE Page 21


CROP YIELD PREDICTION

3.2.1 Product Requirements

 Correctness: It follows a well-defined set of procedures and rules to compute and also

rigorous testing is performed to confirm the correctness of the data.

 Ease of Use: The front end is designed in such a way that it provides an interface which

allows the user to interact in an easy manner.

 Modularity: The complete product is broken up into many modules and well- defined

interfaces are developed to explore the benefit of flexibility of the product.

 Robustness: This software is being developed in such a way that the overall

performance is optimized and the user can expect the results within a limited time

with utmost relevancy and correctness.

Non-functional requirements are also called the qualities of a system. These qualities can be
divided into execution quality & evolution quality. Execution qualities are security & usability of
the system which are observed during run time, whereas evolution quality involves test ability,
maintainability, extensible or scalability.

3.2.2 Organizational Requirements

Process Standards: IEEE standards are used to develop the application which is the standard
used by the most of the standard software developers all over the world.

Design Methods: Design is one of the important stages in the software engineering process.
This stage is the first step in moving from problem to the solution domain. In other words,
starting with what is needed design takes us to work how to satisfy the needs.

Dept of ISE, NHCE Page 22


CROP YIELD PREDICTION

3.2.3 User Requirements

The user requirements document (URD) or user requirements specification is a document


usually used to software engineering that specifies the requirements the user expects from
software to be constructed in a software project. Once the required information is completely
gathered it is documented in a URD, which is meant to spell out exactly what the software must
do and becomes part of the contractual agreement. A customer cannot demand feature not in
the URD, whilst the developer cannot claim the product is ready if it does not meet an item of
the URD.

The URD can be used as a guide to planning cost, timetables, milestones, testing etc. The explicit
nature of the URD allows customers to show it to various stakeholders to make sure all necessary
features are described. Formulating a URD requires negotiation to determine what is technically
and economically feasible. Preparing a URD is one of those skills that lies between a science
and economically feasible. Preparing a URD is one of those skills that lies between a science and
an art, requiring both software technical skills and interpersonal skills.

3.2.4 Basic Operational Requirements

Operational requirement is the process of linking strategic goals and objectives to tactic goals
and objectives. It describes milestones, conditions for success and explains how, or what portion
of, a strategic plan will be put into operation during a given operational period, in the case of, a
strategic plan will be put into operation during a given operational period, in the case of
commercial application, a fiscal year or another given budgetary term. An operational plan is
the basis for, and justification of an annual operating budget request. Therefore, a five-year
strategic plan would typically require five operational plans funded by five operating budgets.

Operational plans should establish the activities and budgets for each part of the organization
for the next 1-3 years. They link the strategic plan with the activities the organization will
deliver and the resources required to deliver them.

Dept of ISE, NHCE Page 23


CROP YIELD PREDICTION

An operational plan draws directly from agency and program strategic plans to describe agency
and program missions and goals, program objectives, and program activities. Like a strategic
plan, an operational plan addresses four questions:

 Where are we now?

 Where do we want to be?

 How do we get there?

The customers are those that perform the eight primary functions of systems engineering, with
special emphasis on the operator as the key customer. Operational requirements will define the
basic need and, at a minimum, will be related to these following points:

Mission profile or scenario: It describes about the procedures used to accomplish mission
objective. It also finds out the effectiveness or efficiency of the system.

Performance and related parameters: It points out the critical system parameters to
accomplish the mission.

Utilization environments: It gives a brief outline of system usage. Finds out appropriate
environments for effective system operation. Operational life cycle: It defines the system
lifetime.

3.3 Hardware Requirements

 Processors : Pentium IV and above

 Processor Speed : 3.00 GHZ

 RAM : 8 GB

 Storage : 20 GB

Dept of ISE, NHCE Page 24


CROP YIELD PREDICTION

3.4 Software Requirements

 Operating system : Windows 7 and above

 Coding Language : Python / AngularJS / HTML / Java script/Bootstrap

 Tools : Sypder/Laveral/MySQL/Xampp Server/Postman

3.5 Theoretical Background

Theoretical background highlighting some topics related to project work. The description
contains several topics which are worth to discuss and also highlight some of their limitation
that encourage going on finding solution as well as highlights some of their advantages for which
reason these topics and their features are used in this project.

3.5.1 Machine learning

Machine learning is a method of data analysis that automates analytically model building. Using
algorithms that iteratively learn from data, machine learning allows computers to find hidden
insights without being explicitly programmed where to look. Re-ensuring interest in machine
learning is due to the same factors that have made data mining and Bayesian analysis more
popular than ever. Things like growing volumes and varieties of available data, computational
processing that is cheaper and more powerful, and affordable data storage.

All of these things mean it’s possible to quickly and automatically produce models that can
analyze bigger, more complex data and deliver faster, more accurate results even on a very
large scale. And by building precise models, an organization has a better chance of identifying
profitable opportunities or avoiding unknown risks. Two of the most widely adopted machine
learning methods are supervised learning and unsupervised learning but there are also other
methods of machine learning. A brief overview of the different machine learning approaches is
mentioned below.

Dept of ISE, NHCE Page 25


CROP YIELD PREDICTION

Supervised learning algorithms are trained using labeled examples, such as an input where the
desired output is known. For example, a piece of equipment could have data points labeled either
/F/ (failed) or /R/ (runs). The learning algorithm receives a set of inputs along with the
corresponding correct outputs, and the algorithm learns by comparing its actual output with
correct outputs to find errors. It then modifies the model accordingly. Through methods like
classification, regression, prediction and gradient boosting, supervised learning uses patterns to
predict the values of the label on additional unlabeled data. Supervised learning is commonly
used in applications where historical data predicts likely future events. For example, it can
anticipate when credit card transactions are likely to be fraudulent or which insurance customer
is likely to file a claim.

Unsupervised learning is used against data that has no historical labels. The system is not told
the “right answer.” The algorithm must figure out what is being shown. The goal is to explore the
data and find some structure within. Unsupervised learning works well on transnational data. For
example, it can identify segments of customers with similar attributes who can then be treated
similarly in marketing campaigns. Or it can find the main attributes that separate customer
segments from each other. Popular techniques include self-organizing maps, nearest-neighbor
mapping, k-means clustering and singular value decomposition. These algorithms are also used
to segment text topics, recommend items and identify data outlines.

Semi supervised learning is used for the same applications as supervised learning. But it uses
both labelled and unlabeled data for training typically a small amount of labelled data with a
large amount of unlabeled data (because unlabeled data is less expensive and takes less effort to
acquire). This type of learning can be used with methods such as classification, regression and
prediction. Semi supervised learning is useful when the cost associated with labelling is too high
to allow for a fully labelled training process. Early examples of this include identifying a person’s
face on a web cam.

Dept of ISE, NHCE Page 26


CROP YIELD PREDICTION

Reinforcement learning is often used for robotics, gaming and navigation. With reinforcement
learning, the algorithm discovers through trial and error which actions yield the greatest
rewards. This type of learning has three primary components: the agent (the learner or decision
maker), the environment (everything the agent interacts with) and actions (what the agent can
do). The objective is for the agent to choose actions that maximize the expected reward over a
given amount of time. The agent will reach the goal much faster by following a good policy. So the
goal in reinforcement learning is to learn the best policy.

3.5.2 Crop yield prediction models

The dependable attributes can be difficult to find. Several methods of predicting and modeling
crop yields have been used in the past with varying success. Farmer has to face the different
problems due to various factors which affect the planning made by him in advance. These
factors do not have the fixed type of impact, it varies time to time, year to year depends on the
situation, climatic nature, increase in costs of various constraints under uncertain environment,
ambiguity and vagueness. Fuzzy logic modeling provides the formulation of mathematical
modeling to find the interface results in uncertain situations. Statistical models often do not
take into account characteristics of the plants, the weather, or the soil attributes limiting their
usefulness. Some models are based on information from just a single year or location. When a
model is developed using single location or year data, it will have limited practical applications,
therefore variability from multiple environments must be included.

3.5.3 Support Vector Machines

Support vector machines (SVM) is set of supervised learning strategies used for classification,
regression and outliers’ discovery. It is a classification technique. Here, we have a tendency to
plot every information item as some extent in n-dimensional house (where n is variety of options
you have) with the worth of every feature being the worth of a selected coordinate. It is a
classification technique. During this algorithmic rule, we have a tendency to plot every
information item as some extent in n-dimensional house (where n is variety of options you have)

Dept of ISE, NHCE Page 27


CROP YIELD PREDICTION

with the worth of every feature being the worth of a selected coordinate. A Support Vector
Machine (SVM) is discriminative classifier correctly bounded by a separating hyper plane. In
alternative words, given labeled coaching information (supervised learning), the algorithmic
rule outputs associate degree best hyper plane that categorizes new examples. Support vector
simple machine (SVM) be a set of supervised learning strategies used for classification, regression
and outliers uncovering.

Figure 3.1: SVM Flowchart

Dept of ISE, NHCE Page 28


CROP YIELD PREDICTION

3.6 Language Specification

3.6.1 Laravel Framework

Laravel is a free, open-source PHP web framework, Laravel are a modular packaging system with
a dedicated dependency manager, different ways for accessing relational databases, utilities
that aid in application deployment and maintenance, and its orientation toward syntactic sugar.
The following features serve as Laravel’s keydesign points

• Bundles provide a modular packaging system since the release of Laravel 3, with bundled
features already available for easy addition to applications. Further- more, Laravel 4 uses
Composer as a dependency manager to add framework- agnostic and Laravel specific
PHP packages available from the Packagist repository.

• Eloquent ORM (object-relational mapping) is an advanced PHP implementation of the


active record pattern, providing at the same time internal methods for enforcing
constraints on the relationships between database objects. Following the active record
pattern, Eloquent ORM presents database tables as classes, with their object instances
tied to single table rows.

• Query builder, available since Laravel 3, provides a more direct database access
alternative to the Eloquent ORM. Instead of requiring SQL queries to be written directly,
Laravel’s query builder provides a set of classes and methods capable of building queries
programmatically. It also allows selectable caching of the results of executed queries.

• Application logic is an integral part of developed applications, implemented either by


using controllers or as part of the route declarations. The syntax used to define
application logic is similar to the one used by Sinatra framework.

• Reverse routing defines a relationship between the links and routes, making it possible
for later changes to routes to be automatically propagated into relevant links. When the
links are created by using names of existing routes, the appropriate uniform resource

Dept of ISE, NHCE Page 29


CROP YIELD PREDICTION

identifiers (URIs) are automatically created by Laravel.

• Restful controllers provide an optional way for separating the logic behind serving HTTP
GET and POST requests.

• Class auto loading provides automated loading of PHP classes without the need for
manual maintenance of inclusion paths. On-demand loading prevents inclusion of
unnecessary components, so only the actually used components are loaded.

• View composers serve as customizable logical code units that can be executed when a
view is loaded.

• Blade templating engine combines one or more templates with a data model to produce
resulting views, doing that by transpiling the templates into cached PHP code for
improved performance. Blade also provides a set of its own control structures such as
conditional statements and loops, which are internally mapped to their PHP
counterparts. Furthermore, Laravel services may be called from Blade templates, and the
templating engine itself can be extended with custom directives.

• IoC containers make it possible for new objects to be generated by following the
inversion of control (IoC) principle, in which the framework calls into the application- or
task-specific code, with optional instantiating and referencing of new objects as
singletons.

• Migrations provide a version control system for database schema, making it possible to
associate changes in the application’s code base and required changes in the database
layout. As a result, this feature simplifies the deployment and updating of Laravel-based
applications.

• Database seeding provides a way to populate database tables with selected de- fault
data that can be used for application testing or be performed as part of the initial
application setup.

Dept of ISE, NHCE Page 30


CROP YIELD PREDICTION

• Unit testing is provided as an integral part of Laravel,[9]:6162 which itself contains unit
tests that detect and prevent regressions in the framework. Unit tests can be run through
the provided artisan command-line utility.

• Automatic pagination simplifies the task of implementing pagination, replacing the usual
manual implementation approaches with automated methods integrated into Laravel.

• Form request is a feature of Laravel 5 that serves as the base for form input validation by
internally binding event listeners, resulting in automated invoking of the form validation
methods and generation of the actual form.

• Homestead - a Vagrant virtual machine that provides Laravel developers

3.6.2 Bootstrap

Bootstrap is a free and open-source front-end library for designing websites and web
applications. It contains HTML- and CSS-based design templates for typography, forms, buttons,
navigation and other interface components, as well as optional JavaScript extensions. Unlike
many web frameworks, it concerns itself with front-end development only. Bootstrap employs a
handful of important global styles and settings that you will need to be aware of when using it,
all of which are almost exclusively geared towards the normalization of cross browser styles.

3.6.3 AngularJS

AngularJS (commonly referred to as ”Angular.js” or ”AngularJS”) is a JavaScript based open source


front-end web application framework mainly maintained by Google and by a community of
individuals and corporations to address many of the challenges encountered in developing single-
page applications. The JavaScript components complement Apache Cordova, a framework used
for developing cross-platform mobile apps. It aims to simplify both the development and the
testing of such applications by providing a framework for client-side modelview- controller

Dept of ISE, NHCE Page 31


CROP YIELD PREDICTION

(MVC) and model view view model (MVVM) architectures, along with components commonly
used in rich Internet applications. In 2014, the original AngularJS team began working on the
Angular application platform.

The AngularJS framework works by first reading the HTML page, which has additional custom
tag attributes embedded into it. Angular interprets those attributes as directives to bind input or
output parts of the page to a model that is represented by standard JavaScript variables. The
values of those JavaScript variables can be manually set within the code, or retrieved from static
or dynamic JSON resources.

AngularJS is a JavaScript-based open-source front-end web application frame- work mainly


maintained by Google and by a community of individuals and corporations to address many of
the challenges encountered in developing single- page applications. AngularJS is a very powerful
JavaScript Framework. It is used in Single Page Application (SPA) projects. It extends HTML DOM
with additional attributes and makes it more responsive to user actions. AngularJS is open
source, completely free, and used by thousands of developers around the world.

3.6.4 PHP

PHP: Hypertext Preprocessor (or simply PHP) is a server-side scripting language designed for
web development but also used as a general-purpose programming language. PHP code may be
embedded into HTML code, or it can be used in combination with various web template
systems, web content management systems, and web frameworks. PHP code is usually
processed by a PHP interpreter implemented as a module in the web server or as a Common
Gateway Interface (CGI) executable. The web server combines the results of the interpreted
and executed PHP code, which may be any type of data, including images, with the generated
web page. PHP code may also be executed with a command-line interface (CLI) and can be used
to implement standalone graphical applications.

Dept of ISE, NHCE Page 32


CROP YIELD PREDICTION

The standard PHP interpreter, powered by the Zend Engine, is free software released under the
PHP License. PHP has been widely ported and can be deployed on most web servers on almost
every operating system and platform, free of charge. The PHP language evolved without a written
formal specification or standard until 2014, leaving the canonical PHP interpreter as a de facto
standard. Since 2014 work has gone on to create a formal PHP specification.

3.6.5 HTML

Hypertext Markup Language is the standard markup language for creating web pages and web
applications. With Cascading Style Sheets and JavaScript, it forms a triad of cornerstone
technologies for the World Wide Web.

3.6.6 CSS

Cascading Style Sheets is a style sheet language used for describing the presentation of a
document written in a markup language like HTML. CSS is a cornerstone technology of the
World Wide Web, alongside HTML and JavaScript.

3.6.7 Multiple Linear Regression

Multiple Linear Regression algorithm is used to predict the crops. Multiple Regression is an
extension of simple Linear Regression. It is used when we want to predict the value of a variable
based on the value of two or more other variables. The variable we want to predict is called the
dependent variable (or sometimes, the outcome, target or criterion variable). The variables we
are using to predict the value of the dependent variable are called the independent variables (or
sometimes, the predictor, explanatory or regressor variables). For example, Multiple Regression
to understand whether exam performance can be predicted based on revision time, test
anxiety, lecture attendance and gender. Multiple Regression also allows you to determine the
overall fit (variance) of the model and the relative contribution of each of the predictors to the
total variance.

Formulae:

Dept of ISE, NHCE Page 33


CROP YIELD PREDICTION

A Linear Regression model that contains more than one predictor variable is called a Multiple
Linear Regression model. The following model is A Multiple Linear Regression model with two
predictor variables, 1 and 2 = 0 + 1 1 + 22+ Where 0, 1, 2 are coefficients of Multiple Linear
Regression.

The model is linear because it is linear in the parameters 0, 1 and 2. The model describes a
plane in the three-dimensional space of, 1 2. The parameter 0 is the intercept of this plane.
Parameters 1 and 2 are referred to as partial regression coefficients. Parameter 1 represents
the change in the mean response corresponding to a unit change in 1 when 2 is held constant.
Parameter 2 represents the change in the mean response corresponding to a unit change in 2
when 1 is held constant.

3.6.8 Python API

In programming more generally, the term API, short for Application Programming Interface,
refers to a part of a computer program designed to be used or manipulated by another
program, as opposed to an interface designed to be used or manipulated by a human. Computer
programs frequently need to communicate amongst themselves or with the underlying
operating system, and API’s are one way they do it. In this tutorial, however, we’ll be using the
term API to refer specifically to web API’s. Flask is a web framework for Python, meaning that it
provides functionality for building web applications, including managing HTTP requests and
rendering templates. In this section, we will create a basic Flask application. In later sections,
we’ll add to this application to create our API. Don’t worry if you don’t understand each
individual line of code explanations will be forthcoming once you have this initial version of the
application working.

Python has a number of web frameworks that can be used to create web apps and APIs. The
most well-known is Django, a framework that has a set project structure and which includes
many built-in tools. This can save time and effort for experienced programmers, but can be
overwhelming. Flask applications tend to be written on a blank canvas, so to speak, and so are
more suited to a contained application such as our prototype API

Dept of ISE, NHCE Page 34


CROP YIELD PREDICTION

Summary

This chapter gives details of the functional requirements, non-functional requirements,


resource requirements, hardware requirements, software requirementsetc. It also concentrates
on the basic theoretical background related to the topic of focus. It gives information about the
developed model technique and also discussed few possible algorithms for the model. The
details of the different modules of the system and gives the step by step flow of each of them.
Along with these, this chapter also highlights some of the important features of the platform
and language used for implementation purpose.

Dept of ISE, NHCE Page 35


CROP YIELD PREDICTION

Chapter 4

SYSTEM DESIGN AND ANALYSIS

4.1 Overview of system design

Design is a meaningful engineering representation of something that is to be built. It is the most


crucial phase in the developments of a system. Software design is a process through which the
requirements are translated into a representation of software. Design is a place where design is
fostered in software Engineering. Based on the user requirements and the detailed analysis of
the existing system, the new system must be designed. This is the phase of system designing.
Design is the perfect way to accurately translate a customer requirement in the finished software
product. Design creates a representation or model, provides details about software data
structure, architecture, interfaces and components that are necessary to implement a system.
The logical system design arrived at as a result of systems analysis is converted into physical
system design.

4.1.1 Preliminary design

The crop yield prediction system using PHP and datasets collected is aimed at easing the yield
of the crop before the actual harvest takes place. The project is web application where the user
as to login to check the yield.

4.1.2 System Development Methodology

System development method is a process through which a product will get completed or a
product gets rid from any problem. Software development process is described as a number of
phases, procedures and steps that gives the complete software. It follows series of steps which is
used for product progress. The development method followed in this project is agile model.

Dept of ISE, NHCE Page 36


CROP YIELD PREDICTION

Agile SDLC model is a combination of iterative and incremental process models with focus on
process adaptability and customer satisfaction by rapid delivery of working software product.
Agile Methods break the product into small incremental builds.

Figure 4.1: Agile model

4.1.3 Model phases

These builds are provided in iterations. Each iteration typically lasts from about one to three
weeks. Every iteration involves cross functional teams working simultaneously on various areas
like

 Planning

 Requirements Analysis

 Design

 Coding

Dept of ISE, NHCE Page 37


CROP YIELD PREDICTION

 Unit Testing and

 Acceptance Testing.

Requirement Analysis: This phase is concerned about collection of requirement of the system.
This process involves generating document and requirement review.

System Design: Keeping the requirements in mind the system specifications are translated in to a
software representation. In this phase the designer emphasizes on:-algorithm, data structure,
software architecture etc.

Coding: In this phase programmer starts his coding in order to give a full sketch of product. In
other words system specifications are only converted in to machine readable compute code.

Implementation: The implementation phase involves the actual coding or programming of the
software. The output of this phase is typically the library, executables, user manuals and
additional software documentation

Testing: In this phase programs (models) are tested to ensure that the complete system meets
the software requirements. The testing is concerned with verification and validation.

Acceptance Testing: In this phase the software is updated to fulfill the changing customer need,
adapt to accommodate change in the external environment, correct errors and oversights
previously undetected in the testing phase, enhance the efficiency of the software

.
4.1.4 Reason for choosing Agile Model as development method

• Is a very realistic approach to software development.

• Promotes teamwork and cross training.

• Functionality can be developed rapidly and demonstrated.

Dept of ISE, NHCE Page 38


CROP YIELD PREDICTION

• Resource requirements are minimum.

• Suitable for fixed or changing requirements

• Delivers early partial working solutions.

• Good model for environments that change steadily.

• Minimal rules, documentation easily employed.

• Enables concurrent development and delivery within an overall planned context.

• Little or no planning required.

• Easy to manage.

• Gives flexibility to developers.

4.1.5 Design Using UML

Designing UML diagram specifies, how the process within the system communicates along with
how the objects with in the process collaborate using both static as well as dynamic UML
diagrams since in this ever-changing world of Object Oriented application development, it has
been getting harder and harder to develop and manage high quality applications in reasonable
amount of time. As a result of this challenge and the need for a universal object modeling
language every one could use, the Unified Modeling Language (UML) is the Information
industries version of blue print. It is a method for describing the systems architecture in detail.
Easier to build or maintains system, and to ensure that the system will hold up to the
requirement changes.

Dept of ISE, NHCE Page 39


CROP YIELD PREDICTION

4.1.6 Architectural Design

The overall logical structure of the project is divided into processing modules and a conceptual
data structure is defined as Architectural Design.

Fig 4.2 architecture of proposed system

4.1.7 Flow chart

Fig 4.3 Flowchart of proposed system

Dept of ISE, NHCE Page 40


CROP YIELD PREDICTION

4.1.8 Use Case Diagram

A use case defines a goal-oriented set of interactions between external entities and the system
under consideration. The external entities which interact with the system are its actors. A set of
use cases describe the complete functionality of the system at a particular level of detail and it
can be graphically denoted by the use casediagram.

The use case diagram of the proposed system is shown in Figure, the system broadly classifies
the functionality of the system into components that perform the actions of image processing:-
processing image, training image data set, compare the trained model with the uploaded image.
Another functionality is the fetching of sensor readings and it is done by the server admin and the
readings are analyzed to give an output to the user.

The user or the farmer in this case will get the results on his phone through the applications.
The following are the actors and use cases:

Actors

 End User

 Server

Admin Use Cases

 Login

 Sign Up

 View Datasets

 Predict

 Display results

Dept of ISE, NHCE Page 41


CROP YIELD PREDICTION

Figure 4.4: Shows the user case diagram

4.1.8.1 Activity Diagram

An activity diagram shows the sequence of steps that make up a complex process. An activity is
shown as a round box containing the name of the operation. An outgoing solid arrow attached
to the end of the activity symbol indicates a transition triggered by the completion.

The figure above shows the activity diagram for the overall process. The farmer will launch the
application. The application is the main source for the retrieval of data. Application provides the
functionality for retriving data from server. The farmer requests the required data from the
application, the application then connects to the server. Server retrieves the data from the
database through which the data retrieval, the server analyzes the data and sends them along
with the result. Application fetches the results from the server and displays it to the user or the
farmer.

Dept of ISE, NHCE Page 42


CROP YIELD PREDICTION

4.1.8.2 Sequence Diagram

Sequence diagrams are an easy and intuitive way of describing the behavior of a system by viewing
the interaction between the system and the environment. A sequence diagram shows an
interaction arranged in a time sequence. A sequence diagram has two dimensions: vertical
dimension represents time, the horizontal dimension represents the objects existence during
the interaction.

Basic elements:

 Vertical rectangle: represent the object is active (method is being performed).

 Vertical dashed line: represent the life of the object.

 X: represent the life end of an object. (Being destroyed from memory)

 Horizontal line with arrows: messages from one object to another

4.2 Overview of system analysis

Analysis is the process of finding the best solution to the problem. System analysis is the process
by which we learn about the existing problems, define objects and requirements and evaluates
the solutions. It is the way of thinking about the organization and the problem it involves, a set of
technologies that helps in solving these problems. Feasibility study plays an important role in
system analysis which gives the target for design and development.

4.2.1 Feasibility Study

All systems are feasible when provided with unlimited resource and infinite time. But
unfortunately, this condition does not prevail in practical world. So it is both necessary and prudent
to evaluate the feasibility of the system at the earliest possible time. Months or years of effort,
thousands of rupees and untold professional embarrassment can be averted if an ill-conceived

Dept of ISE, NHCE Page 43


CROP YIELD PREDICTION

system is recognized early in the definition phase. Feasibility & risk analysis are related in many
ways. If project risk is great, the feasibility of producing quality software is reduced. In this case
there are three primary areas of interest:-

4.2.1.1 Performance Analysis

For the complete functionality of the project work, the project is run with the help of healthy
networking environment. Normally, the OS is windows 7. The main theme of this project is to
design a system that correctly identifies plant diseases and generates output specific data.
Performance analysis is done to find out whether the proposed system is time efficient and
accurate. It is essential that the process of performance analysis and definition must be
conducted in parallel.

4.2.1.2 Technical Analysis


System is only beneficial only if it can be turned into information systems that will meet the
organizations technical requirement. Simply stated this test of feasibility asks whether the system
will work or not when developed & installed, whether there are any major barriers to
implementation. Regarding all these issues in technical analysis there are several points to focus
on:-

Changes to bring in the system: All changes should be in positive direction, there will be
increased level of efficiency and better customer service.

Required skills: Platforms & tools used in this project are widely used. So the skilled manpower
is readily available in the industry.

Acceptability: The structure of the system is kept feasible enough so that there should not be
any problem from the users’ point of view.

Dept of ISE, NHCE Page 44


CROP YIELD PREDICTION

4.2.1.3 Economic Analysis

Economical analysis is performed to evaluate the development cost weighed against the
ultimate income or benefits derived from the developed system. For running this system, we
simply need a computer. All the features in this system run even on the other Operating
Systems. So the system is economically feasible enough.

Summary

This chapter mainly concentrates on few fundamental design concepts such as system
development methodology, system architecture, class diagram, flowchart, sequence diagram,
use-case diagram, activity diagram, data flow diagram etc. This chapter also find out whether
the system is feasible enough or not. For these reasons different kinds of analysis, such as
performance analysis, technical analysis, economical analysis etc. is performed.

Dept of ISE, NHCE Page 45


CROP YIELD PREDICTION

Figure 4.5: UML notations-1

Dept of ISE, NHCE Page 46


CROP YIELD PREDICTION

Figure 4.6: UML notations-2

Dept of ISE, NHCE Page 47


CROP YIELD PREDICTION

Figure 4.7: Shows the sequence diagram for login page

Figure 4.8: Shows the sequence diagram for sign up page

Dept of ISE, NHCE Page 48


CROP YIELD PREDICTION

Figure 4.9: Shows the sequence diagram for datasets

Figure 4.10: Shows the sequence diagram for update profile page

Dept of ISE, NHCE Page 49


CROP YIELD PREDICTION

Chapter 5

IMPLEMENTATION
The implementation phase of the project is where the detailed design is actually transformed
into working code. Aim of the phase is to translate the design into a best possible solution in a
suitable programming language. This chapter covers the implementation aspects of the project,
giving details of the programming language and development environment used. The
implementation stage requires the following tasks

 Careful planning.

 Investigation of system and constraints.

 Design of methods to achieve the changeover.

 Evaluation of the changeover method.

 Correct decisions regarding selection of the platform

 Appropriate selection of the language for application development

5.1 python code for getting the predicted result in graph

#!/usr/bin/python
# -*- coding: utf-8 -*-

from flask import Flask, jsonify, request


import json
app = Flask(__name__)

@app.route('/getPrediction', methods=['POST'])
def prediction():

Dept of ISE, NHCE Page 50


CROP YIELD PREDICTION

data = request.json['crop']

import pandas as pd
if data == 'Ragi':
testData = pd.read_csv('RagiTestDatasets.csv')
Test_X = testData.iloc[:, :6].values
Test_Y = testData.iloc[:, 6].values

# Import training Datasets

trainingData = pd.read_csv('RagiTrainingDatasets.csv')
training_X = trainingData.iloc[:, :6].values
training_Y = trainingData.iloc[:, 6].values
elif data == 'Rice':
testData = pd.read_csv('RiceTestDatasets.csv')
Test_X = testData.iloc[:, :6].values
Test_Y = testData.iloc[:, 6].values

# Import training Datasets

trainingData = pd.read_csv('RiceTrainingDatasets.csv')
training_X = trainingData.iloc[:, :6].values
training_Y = trainingData.iloc[:, 6].values
elif data == 'Sugarcane':

testData = pd.read_csv('SugarcaneTestDatasets.csv')
Test_X = testData.iloc[:, :6].values
Test_Y = testData.iloc[:, 6].values

Dept of ISE, NHCE Page 51


CROP YIELD PREDICTION

# Import training Datasets

trainingData = pd.read_csv('SugarcaneTrainingDatasets.csv')
training_X = trainingData.iloc[:, :6].values

training_Y = trainingData.iloc[:, 6].values


else:
return jsonify({'status': 500, 'Error': 'Invalid Request'})

# Applying Multi Linear Regression Alogrithm

from sklearn.linear_model import LinearRegression


regressor = LinearRegression()
regressor.fit(training_X, training_Y)

y_pred = regressor.predict(Test_X)

predictionResult = pd.Series(y_pred).to_json(orient='values')

# training Month
TrainingMonth = trainingData.iloc[:, 7].values
TrainMonth = pd.Series(TrainingMonth).to_json(orient='values')

# training Data
TrainingData = trainingData.iloc[:, 6].values
TrainData = pd.Series(TrainingData).to_json(orient='values')

# test Month

Dept of ISE, NHCE Page 52


CROP YIELD PREDICTION

TestMonth = testData.iloc[:, 7].values


TestMonth = pd.Series(TestMonth).to_json(orient='values')

# test Data
TestingData = testData.iloc[:, 6].values
TestData = pd.Series(TestingData).to_json(orient='values')

return jsonify({
'status': 200,
'crop': data,
'TrainingMonths': TrainMonth,
'TrainingData': TrainData,
'TestMonths': TestMonth,
'TestingData': TestData,
'predictionResult': predictionResult,
})

if __name__ == '__main__':
app.run(debug=True)

5.2 PHP code

#home.php
<?php
session_start();
include('includes/config.php');

?>

Dept of ISE, NHCE Page 53


CROP YIELD PREDICTION

<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">

<title>News Portal | Home Page</title>

<!-- Bootstrap core CSS -->


<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->


<link href="css/modern-business.css" rel="stylesheet">

</head>

<body>

<!-- Navigation -->


<?php include('includes/header.php');?>

<!-- Page Content -->


<div class="container">

<div class="row" style="margin-top: 4%">

Dept of ISE, NHCE Page 54


CROP YIELD PREDICTION

<!-- Blog Entries Column -->


<div class="col-md-8">

<!-- Blog Post -->


<?php
if (isset($_GET['pageno'])) {
$pageno = $_GET['pageno'];
} else {
$pageno = 1;
}
$no_of_records_per_page = 8;
$offset = ($pageno-1) * $no_of_records_per_page;

$total_pages_sql = "SELECT COUNT(*) FROM tblposts";


$result = mysqli_query($con,$total_pages_sql);
$total_rows = mysqli_fetch_array($result)[0];
$total_pages = ceil($total_rows / $no_of_records_per_page);

$query=mysqli_query($con,"select tblposts.id as pid,tblposts.PostTitle as


posttitle,tblposts.PostImage,tblcategory.CategoryName as category,tblcategory.id as
cid,tblsubcategory.Subcategory as subcategory,tblposts.PostDetails as
postdetails,tblposts.PostingDate as postingdate,tblposts.PostUrl as url from tblposts left join
tblcategory on tblcategory.id=tblposts.CategoryId left join tblsubcategory on
tblsubcategory.SubCategoryId=tblposts.SubCategoryId where tblposts.Is_Active=1 order by
tblposts.id desc LIMIT $offset, $no_of_records_per_page");
while ($row=mysqli_fetch_array($query)) {

Dept of ISE, NHCE Page 55


CROP YIELD PREDICTION

?>

<div class="card mb-4">


<img class="card-img-top" src="admin/postimages/<?php echo
htmlentities($row['PostImage']);?>" alt="<?php echo htmlentities($row['posttitle']);?>">
<div class="card-body">
<h2 class="card-title"><?php echo htmlentities($row['posttitle']);?></h2>
<p><b>Category : </b> <a href="category.php?catid=<?php echo
htmlentities($row['cid'])?>"><?php echo htmlentities($row['category']);?></a> </p>

<a href="news-details.php?nid=<?php echo htmlentities($row['pid'])?>" class="btn btn-


primary">Read More &rarr;</a>
</div>
<div class="card-footer text-muted">
Posted on <?php echo htmlentities($row['postingdate']);?>

</div>
</div>
<?php } ?>

<!-- Pagination -->

<ul class="pagination justify-content-center mb-4">


<li class="page-item"><a href="?pageno=1" class="page-link">First</a></li>
<li class="<?php if($pageno <= 1){ echo 'disabled'; } ?> page-item">
<a href="<?php if($pageno <= 1){ echo '#'; } else { echo "?pageno=".($pageno - 1); } ?>"
class="page-link">Prev</a>
</li>

Dept of ISE, NHCE Page 56


CROP YIELD PREDICTION

<li class="<?php if($pageno >= $total_pages){ echo 'disabled'; } ?> page-item">


<a href="<?php if($pageno >= $total_pages){ echo '#'; } else { echo "?pageno=".($pageno + 1); }
?> " class="page-link">Next</a>
</li>
<li class="page-item"><a href="?pageno=<?php echo $total_pages; ?>" class="page-
link">Last</a></li>
</ul>

</div>

<!-- Sidebar Widgets Column -->


<?php include('includes/sidebar.php');?>
</div>
<!-- /.row -->

</div>
<!-- /.container -->

<!-- Footer -->


<?php include('includes/footer.php');?>

<!-- Bootstrap core JavaScript -->


<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

</head>
</body>

Dept of ISE, NHCE Page 57


CROP YIELD PREDICTION

</html>

#Predictiongraph.php
<!DOCTYP-E html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-
Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-
KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-
ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-
JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/4.5.0/css/font-awesome.min.css" integrity="sha384-

Dept of ISE, NHCE Page 58


CROP YIELD PREDICTION

XdYbMnZ/QjLh6iI4ogqCTaIjrFk87ip+ekIjefZch0Y+PvJ8CDYtEs1ipDmPorQ+"
crossorigin="anonymous">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700">

<!--@author Prasada -->


<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/series-label.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-
bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-
1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"
crossorigin="anonymous">
{{-- <link href="{{ elixir('css/app.css') }}" rel="stylesheet"> --}}
<style type="text/css">
body{
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background-image: url("../public/prediction.jpg");
background-size: cover;
background-repeat: no-repeat;
/* background-color: pink;*/
}

Dept of ISE, NHCE Page 59


CROP YIELD PREDICTION

html {
background-image:url('{{ asset('/../public/prediction.jpg') }}');
background-size: cover;
background-repeat: no-repeat;
}
select.form-control:not([size]):not([multiple]) {
height: calc(3.25rem + 2px);
}
.dropdown-toggle::after {
display: none;
}

#container {
min-width: 310px;
max-width: 800px;
height: 400px;
margin: 0 auto
}

.fa-btn {
margin-right: 6px;
}
#v-pills-tab{
padding-top: 83px;
}

.tableContentTab{

Dept of ISE, NHCE Page 60


CROP YIELD PREDICTION

padding-top: 84px;
padding-left: 71px;
}
/*#v-pills-home{
font-weight: 700;
word-wrap: break-word;

}*/
#v-pills-home {
font-weight: 700;
word-wrap: break-word;
word-spacing: 8px;
}
.tabdatasets1{
margin-left: 83px;
margin-top: 10px;
}
.tabdatasets2{
margin-left: 81px;
margin-top: 24px;
}
.tabdatasets3{
margin-left: 204px;
margin-top: 33px;
}
.inputbox
{
font-weight: 700;
}

Dept of ISE, NHCE Page 61


CROP YIELD PREDICTION

.tabdatasets4{
margin-left: 98px;
}
.tadprediction1{
margin-top: 47px;
margin-left: 115px;
}
.tadprediction2{
margin-left: 67px;
}
.cpypc{
padding-left: 10px;
}
.nav-link {
display: block;
padding: 1rem;
}
.navbartop{
background-color: #6998e6;
}
.navbartop1{
color: white;
}
.navbartop2{
color: white;
}.navbartop3{getdatasets
color: white;
}
</style>

Dept of ISE, NHCE Page 62


CROP YIELD PREDICTION

<script type="text/javascript">
var $response = [];
function getdatasets(){
var token = "<?php echo csrf_token(); ?>";
$.ajax({
type: 'post',
url: '{{URL::to('/getDataset')}}',
data: {
parameter: $('#inputState').val(),
yearfrom: $('#from').val(),
yearto: $('#to').val(),
_token:token,
},

success: function(response,status) { console.log("response",response);


$response=response.datasets;
flag=true;

},
error : function(response,status){
var errorMessage = response.responseJSON.errors;
console.log("errorMessage",errorMessage);
}

});
}
</script>
<title>Crop Yield Prediction</title>
</head>

Dept of ISE, NHCE Page 63


CROP YIELD PREDICTION

<body class="main" ng-app="myApp" ng-controller="PostController">


<nav class="navbar navbar-default navbar-static-top navbartop">
<div class="container">
<div class="collapse navbar-collapse" id="app-navbar-collapse">
<!-- Left Side Of Navbar -->
<a class="navbar-brand cpypc navbartop1" href="{{ url('/home') }}">
CropYield Prediction
</a>
<!-- Right Side Of Navbar -->
<ul class="nav navbar-nav navbar-right">
<!-- Authentication Links -->
@if (!Auth::guest())
<li class="dropdown">
<a href="#" class="dropdown-toggle ncypc navbartop3" data-toggle="dropdown"
role="button">
{{ Auth::user()->name }} <span class="caret"></span>
</a>

<ul class="dropdown-menu" role="menu">


<li><a href="{{ url('/logout') }}"><i class="fa fa-btn fa-sign-out"></i>Logout</a></li>
</ul>
</li>
@endif
</ul>
</div>
</div>
</nav>

<!-- JavaScripts -->

Dept of ISE, NHCE Page 64


CROP YIELD PREDICTION

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js"
integrity="sha384-
I6F5OKECLVtK/BL+8iSLDEHowSAfUo76ZL9+kGAgTRdiByINKJaqTPH/QVNS1VDb"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js"
integrity="sha384-
0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
crossorigin="anonymous"></script>
{{-- <script src="{{ elixir('js/app.js') }}"></script> --}}
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 col-lg-4 nav flex-column nav-pills" id="v-pills-tab" role="tablist"
aria-orientation="vertical">
<a class="nav-link active" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home"
role="tab" aria-controls="v-pills-home" aria-selected="true">update profile</a>
<a class="nav-link" id="v-pills-profile-tab" data-toggle="pill" href="#v-pills-profile" role="tab"
aria-controls="v-pills-profile" aria-selected="false">Data Sets</a>
<a class="nav-link" id="v-pills-messages-tab" data-toggle="pill" href="#v-pills-messages"
role="tab" aria-controls="v-pills-messages" aria-selected="false">Prediction Result</a>
</div>
<div class="tab-content col-xs-12 col-md-4 col-lg-8" id="v-pills-tabContent tableContentTab"
style="padding-left:30px;padding-top:83px">
<div class="tab-pane fade show active vphome" id="v-pills-home" role="tabpanel" aria-
labelledby="v-pills-home-tab">
<div class="form-group">
<div class="one"><label for="fname">First Name</label></div>
<div class="two"><input class="form-control" name="fname" type="text" placeholder="First
Name" ng-model="login.fname"></div>

Dept of ISE, NHCE Page 65


CROP YIELD PREDICTION

<div class="clr"></div>
</div>
<div class="form-group">
<div class="one"><label for="lname">Last Name</label></div>
<div class="two"><input class="form-control" name="lname" type="text" placeholder="Last
Name" ng-model="login.lname"></div>
<div class="clr"></div>
</div>
<div class="form-group">
<div class="one"><label for="phonenumber">Phone Number</label></div>
<div class="two"><input class="form-control" name="phonenumber" type="tel"
placeholder="Phone Number" ng-model="login.phonenumber"></div>
<div class="clr"></div>
</div>
<div class="form-group">
<div class="one"><label for="password">Password </label></div>
<div class="two"><input class="form-control" name="password" type="password"
placeholder="Password" ng-model="login.password"></div>
<div class="clr"></div>
</div>
<div class="form-group">
<div class="two submit1">
<button class="btn btn-primary btn-lg" name="submit" type="submit" ng-
click="updateProfile();">Save</button>
</div>
</div>
</div>
<div class="tab-pane fade tabdatasets" id="v-pills-profile" role="tabpanel" aria-labelledby="v-
pills-profile-tab">

Dept of ISE, NHCE Page 66


CROP YIELD PREDICTION

<form enctype="multipart/form-data" id="validateAddCollege">


<div class="form-row">
<div class="form-group col-md-6 col-lg-6 tabdatasets1">
<label for="inputState" class="inputbox">Parameters</label>
<select id="parameter" name="inputState" class="form-control" ng-model="parameter">
<option selected>Choose...</option>
<option>Temparature</option>
<option>Rain Fall</option>
<option>Pressure</option>
<option>Humidity</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 col-lg-6 tabdatasets2 inputbox">
<label class="control-label" for="date">From</label>
<select id="fromdate" name="inputState" class="form-control" ng-model="fromdate">
<option selected>Choose...</option>

<option>1982</option>
<option>1983</option>

</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 col-lg-6 tabdatasets2 inputbox">
<label class="control-label" for="date">To</label>
<select id="todate" name="inputState" class="form-control" ng-model="todate">

Dept of ISE, NHCE Page 67


CROP YIELD PREDICTION

<option selected>Choose...</option>
<option>1901</option>
<option>1902</option>
<option>1903</option>
<option>1904</option>
<option>1905</option>

</select>
</div>
</div>
<button type="button" class="btn btn-primary tabdatasets3" ng-
click="retrieveFunction();flag=true"> get datasets</button>
<div ng-if="flag">
<table style="width:100%;background-color: white;color: black" border="5px" >
<tr>
<th>City</th>
<th>Year</th>
<th>Month</th>
<th ng-if="parameter=='Temparature'">Average Min Temparature</th>
<th ng-if="parameter=='Temparature'">Average Max Temparature</th>
<th ng-if="parameter=='Rain Fall'">Rain fall</th>
<th ng-if="parameter=='Pressure'">Pressure</th>

</tr>
<tr ng-repeat="dt in details">
<td ng-bind="dt.city_name"></td>
<td ng-bind="dt.year"></td>
<td ng-bind="dt.month"></td>
<td ng-if="parameter=='Temparature'" ng-bind="dt.min_temperature"></td>

Dept of ISE, NHCE Page 68


CROP YIELD PREDICTION

<td ng-if="parameter=='Temparature'" ng-bind="dt.max_temperature"></td>


<td ng-if="parameter=='Rain Fall'" ng-bind="dt.rainfall"></td>
<td ng-if="parameter=='Pressure'" ng-bind="dt.pressure"></td>
</tr>
</table>
</div>
</form>
</div>
<div class="tab-pane fade tadprediction1" id="v-pills-messages" role="tabpanel" aria-
labelledby="v-pills-messages-tab">
<!-- <h1>PREDICTION RESULT</h1> -->
<!-- author Prasada-->
<form>
<div class="form-row">
<div class="form-group col-md-6 col-lg-6 tabprediction2 inputbox" placeholder="Choose...">
<label class="control-label" for="crop">Choose Crop</label>
<select id="crop" name="inputState" class="form-control" ng-model="crop">
<option selected>Choose...</option>
<option>Ragi</option>
<option>Rice</option>
<option>Sugarcane</option>

</select>
</div>
</div>
<div class="form-row" >
<button type="submit" class="btn btn-primary tadprediction2" ng-
click='getPredictionResult()'>Prediction Result</button>
</div>

Dept of ISE, NHCE Page 69


CROP YIELD PREDICTION

<div id="container"></div>
</form>

</div>
</div>
</body>
</html>
<!-- <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> -->

<script>
predictionResult = [];
var app = angular.module('myApp',[]);
app.controller('PostController',function($scope,$http){
$scope.details = [];
$scope.predictionResult = [];
$scope.flag=false;
$scope.retrieveFunction=function()
{
$http({
method: "post",
url: '{{URL::to('/getDataset')}}',
headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
data:$.param({
'parameter':$scope.parameter,
'from':$scope.fromdate,
'to':$scope.todate
})
}).then(function (response) {

Dept of ISE, NHCE Page 70


CROP YIELD PREDICTION

$scope.details=response.data.datasets;
$scope.flag=true;
}, function (error) {
alert("Failed");

})
console.log("Failed")
}
<!-- author Prasada-->
$scope.getPredictionResult=function()
{
var requestData = {
"crop":$scope.crop

};

$http.post("http://127.0.0.1:5000/getPrediction", requestData)
.then(function (response) {
predictionResult=response.data.result;
console.log(predictionResult);
}, function (error) {
alert("Failed");

})

Highcharts.chart('container', {

title: {
text: 'Crop Yield Prediction'

Dept of ISE, NHCE Page 71


CROP YIELD PREDICTION

},

yAxis: {
title: {
text: 'Crop Yield'
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle'
},

plotOptions: {
series: {
label: {
connectorAllowed: false
},
pointStart: 2010
}
},

series: [{
name: 'Predicted',

data: predictionResult
//data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]

}, {

Dept of ISE, NHCE Page 72


CROP YIELD PREDICTION

name: 'Actual',
data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
}],

responsive: {
rules: [{
condition: {
maxWidth: 500
},
chartOptions: {
legend: {
layout: 'horizontal',
align: 'center',
verticalAlign: 'bottom'
}
}
}]
}

});

$scope.updateProfile = function()
{
$http({
method:"post",
url:"{{URL::to('/updateProfile')}}",
headers:{'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'},

Dept of ISE, NHCE Page 73


CROP YIELD PREDICTION

data:$.param({
'fname':$scope.login.fname,
'lname':$scope.login.lname,
'phonenumber':$scope.login.phonenumber,
'password':$scope.login.password
})
}).success(function(response,status){

}).error(function(response,status){

});}
});

</script>

Summary

The chapter discusses the implementation details of the different modules of the system and
gives the step by step flow of each of them. Along with these, this chapter also highlights some
of the important features of the platformand language used for implementation purpose.

Dept of ISE, NHCE Page 74


CROP YIELD PREDICTION

Chapter 6

TESTING
System testing is actually a series of different tests whose primary purpose is to fully exercise
the computer-based system. Although each test has a different purpose, all work to verify that
all the system elements have been properly integrated and perform allocated functions. The
testing process is actually carried out to make sure that the product exactly does the same thing
what is supposed to do. In the testing stage following goals are tried to achieve:-

 To affirm the quality of the project.

 To find and eliminate any residual errors from previous stages.

 To validate the software as a solution to the original problem.

 To provide operational reliability of the system.

Testing is the most important part of the software development process. Some of the reasons
for its importance are as follows:

 Testing helps find the bugs in the software which prevent the program from performing
the required tasks.

 Bug fixing in the early stages helps to save a lot of time.

 Testing is essential to ensure that the product will work well once deployed.

 Testing improves the quality of the software.

Validation is the process of ensuring that the software built is in accordance with the business
requirements. It assures customer satisfaction.

Dept of ISE, NHCE Page 75


CROP YIELD PREDICTION

6.1 Functional testing

This type of testing is done against the functional requirements of the project.
Types:
 Unit testing: Each unit /module of the project is individually tested to check for bugs. If

any bugs found by the testing team, it is reported to the developer for fixing.

 Integration testing: All the units are now integrated as one single unit and checked for

bugs. This also checks if all the modules are working properly with each other.

 System testing: This testing checks for operating system compatibility. It includes both

functional and non functional requirements.

 Sanity testing: It ensures change in the code doesn’t affect the working of the project.

 Smoke testing: this type of testing is a set of small tests designed for each build.

 Interface testing: Testing of the interface and its proper functioning.

 Regression testing: Testing the software repetitively when a new requirement is added,

when bug fixed etc.

 Beta/Acceptance testing: User level testing to obtain user feedback on the product.

6.2 Non-functional testing

This type of testing is mainly concerned with the non-functional requirements such as
performance of the system under various scenarios.
 Performance testing: Checks for speed, stability and reliability of the software, hardware

or even the network of the system under test.

Dept of ISE, NHCE Page 76


CROP YIELD PREDICTION

 Compatibility testing: This type of testing checks for compatibility of the system with

different operating systems, different networks etc.

 Localization testing: This checks for the localized version of the product mainly

concerned with UI.

 Security testing: Checks if the software has vulnerabilities and if any, fix them.

 Reliability testing: Checks for the reliability of the software

 Stress testing: This testing checks the performance of the system when it is exposed to

different stress levels.

 Usability testing: Type of testing checks the easily the software is being used by the

customers.

 Compliance testing: Type of testing to determine the compliance of a system with

internal or external standards.

6.3 Testing Methodologies

There are many different types of testing methods or techniques used as part of the software
testing methodology. Some of the important testing methodologies are:

6.3.1 White box testing

White box testing (clear box testing, glass box testing, and transparent box testing or structural
testing) uses an internal perspective of the system to design test cases based on internal
structure. It requires programming skills to identify all paths through the software. The tester
chooses test case inputs to exercise paths through the code and determines the appropriate
outputs. While white box testing is applicable at the unit, integration and system levels of the

Dept of ISE, NHCE Page 77


CROP YIELD PREDICTION

software testing process, it is typically applied to the unit. While it normally test paths
within a unit, it can also test paths between units during integration, and between subsystems
during a system level test.

Though this method of test design can uncover an overwhelming number of test cases, it might
not detect unimplemented parts of the specification or missing requirements, but one can be
sure that all paths through the test object are executed. Using white box testing we can derive
test cases that:

– Guarantee that all independent paths within a module have been exercised at least once.

– Exercise all logical decisions on their true and false sides.

– Execute all loops at their boundaries and within their operational bounds.

– Execute internal data structure to assure their validity

6.3.2 Black box testing

Black box testing focuses on the functional requirements of the software. It is also known as
functional testing. It is a software testing technique whereby the internal workings of the item
being tested are not known by the tester. For example, in a black box test on software design the
tester only knows the inputs and what the expected outcomes should be and not how the
program arrives at those outputs.

The tester does not ever examine the programming code and does not need any further
knowledge of the program other than its specifications. It enables us to derive sets of input
conditions that will fully exercise all functional requirements for a program. Black box testing is
an alternative to white box technique. Rather it is a complementary approach that is likely to
uncover a different class of errors in the following categories:-

 Incorrect or missing function.

 Interface errors.

Dept of ISE, NHCE Page 78


CROP YIELD PREDICTION

 Performance errors.

 Initialization and termination errors.

 Errors in objects.

Advantages

 The test is unbiased as the designer and the tester are independent of each other.

 The tester does not need knowledge of any specific programming languages.

 The test is done from the point of view of the user, not the designer.

 Test cases can be designed as soon as the specifications are complete.

6.4 Testing levels

Fig.6.1. Represents different levels of testing during the SDLC.

Dept of ISE, NHCE Page 79


CROP YIELD PREDICTION

6.4.1 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.

6.4.2 Integration Testing

Upon completion of unit testing, integration testing begins. Individual modules are combined
and tested as a group. Integration testing is black box testing. The purpose of integration
testing is to ensure distinct components of the application still work in accordance to user
requirements. Integration testing is considered complete, when actual results and expected
results are either in line or differences are explainable based on client input. It concentrates on
data transfer between modules. Integration testing is a logical extension of unit testing. Two
units that have already been tested are combined into a component and the interface between
them is tested. Integration testing identifies problems that occur when units are combined .The
errors that arise can be attributed to those occurring due to the combination of modules,
resulting from errors across interface.

The Integration Testing Table the functions that are combined into different classes and the
module as a whole tested for its functionality. Finally all the modules are integrated and tested.
This is important to check for error-free interaction between various classes and its modules.
The integration testing table shows the important modules integrated.

Dept of ISE, NHCE Page 80


CROP YIELD PREDICTION

6.4.3 System Testing

System testing of software or hardware is testing conducted on a complete, integrated system


to evaluate the system’s compliance with its specified requirements. System testing falls within
the scope of black box testing, and as such, should require no knowledge of the inner design of
the code or logic.

As a rule, system testing takes, as its input, all of the ”integrated” software components that
have passed integration testing and also the software system itself integrated with any
applicable hardware system(s). The purpose of integration testing is to detect any
inconsistencies between the software units that are integrated together (called assemblages) or
between any of the assemblages and the hardware. System testing is a more limited type of
testing; it seeks to detect defects both within the”inter-assemblages” and also within the
system as a whole.

System testing is performed on the entire system in the context of a Functional Requirement
Specification(s) (FRS) and/or a System Requirement Specification (SRS). System testing tests not
only the design, but also the behavior and even the believed expectations of the customer. It is
also intended to test up to and beyond the bounds defined in the software/hardware
requirements specification(s).

The following examples are different types of testing that should be considered during System
testing:

– Graphical user interface testing

– Usability testing

– Software performance testing

– Compatibility testing

– Exception handling

Dept of ISE, NHCE Page 81


CROP YIELD PREDICTION

– Load testing

– Volume testing

Different testing organizations may prescribe different tests as part of System testing. The

following are few test cases of the project:

Test case no 1
Module Tested Login Credentials
Input Email Address
Password
Excepted Output Entry to the website with correct credentials
Actual Output Entry to the website with correct credentials
Comments Successful

Table 6.1: Test case for Login Credentials

Test case no 2
Module Tested Sig Up Credentials
Input First Name
Last Name Email
Address Phone
Number
Password
Confirm Password
Excepted Output Entry to the website with correct credentials
Actual Output Entry to the website with correct credentials
Comments Successful

Table 6.2: Test case for Sign Up Credentials

Dept of ISE, NHCE Page 82


CROP YIELD PREDICTION

Test case no 3
Module Tested User Profile Update
Input First Name
Last Name
Phone Number
Password
Excepted Output Update Profile Details
Actual Output Update Profile Details
Comments Successful

Table 6.3: Test case for Update Profile Details

Test case no 4
Module Tested Logout
Input Click on Logout
Excepted Output Exit from website to login page
Actual Output Exit from website to login page
Comments Successful
Table 6.4: Test case for Logout

Test case no 5
Module Tested Datasets
Input Parameter(Rainfall, Temperature, etc)
From
To
Excepted Output Datasets for selected parameter and year range
Actual Output Datasets for selected parameter and year range
Comments Successful

Table 6.5: Test case for Datasets Display

Dept of ISE, NHCE Page 83


CROP YIELD PREDICTION

Test case no 6
Module Tested Prediction Result
Input Crop Name
Excepted Output Graph for predicted and actual yield of selected crop
Actual Output Graph for predicted and actual yield of selected crop
Comments Successful

Table 6.6: Test case for Prediction Result Graph

6.5 Quality Assurance

Quality assurance consists of the auditing and reporting functions of management. The goal of
quality assurance is to provide management with the data necessary to be informed about
product quality, thereby gaining insight and confident that the product quality is meeting its
goals. This is an umbrella activity that is applied throughout the engineering process. Software
quality assurance encompasses:-

– Analysis, design, coding and testing methods and tools

– Formal technical reviews that are applied during each software engineering

– Multi-tier testing strategy

– Control of software documentation and the change made to it

– A procedure to ensure compliance with software development standards.

– Measurement and reporting mechanisms.

Dept of ISE, NHCE Page 84


CROP YIELD PREDICTION

Quality Assurance (QA) is a way of preventing mistakes or defects in manufactured products and
avoiding problems when delivering solutions or services to customers. QA is applied to physical
products in pre-production to verify what will be made meets specifications and requirements,
and during manufacturing production runs by validating lot samples meet specified quality
controls. QA is also applied to software to verify that features and functionality meet business
objectives, and that code is relatively bug free prior to shipping or releasing new software
products and versions. Quality Assurance refers to administrative and procedural activities
implemented in a quality system so that requirements and goals for a product, service or activity
will be fulfilled. It is the systematic measurement, comparison with a standard, monitoring of
processes and an associated feedback loop that confers error prevention. This can be contrasted
with quality control, which is focused on process output.

Two principles included in Quality Assurance are “Fit for purpose”, the product should be
suitable for the intended purpose; and “Right first time”, mistakes should be eliminated. QA
includes management of the quality of raw materials, assemblies, products and components,
services related to production, and management, production and inspection processes. Suitable
quality is determined by product users, clients or customers, not by society in general. It is not
related to cost, and adjectives or descriptors such as “high” and “poor” are not applicable. For
example, a low priced product may be viewed as having high quality because it is disposable,
where another may be viewed as having poor quality because it is not disposable.

Software quality assurance (SQA) consists of a means of monitoring the soft- ware engineering
processes and methods used to ensure quality. The methods by which this is accomplished are
many and varied, and may include ensuring conformance to one or more standards, such as ISO
9000 or a model such as CMMI.SQA encompasses the entire software development process,
which includes processes such as requirements definition, software design, coding, source code
control, code reviews, software configuration management, testing, release management, and
product integration.

Dept of ISE, NHCE Page 85


CROP YIELD PREDICTION

6.5.1 Quality Factors

An important objective of quality assurance is to track the software quality and assess the
impact of methodological and procedural changes on improved software quality. The factors
that affect the quality can be categorized into two broad groups:

– Factors that can be directly measured.

– Factors that can be indirectly measured

These factors focus on three important aspects of a software product

– Its operational characteristics

– Its ability to undergo changes

– Its adaptability to a new environment.

– Effectiveness or efficiency in performing its mission

– Duration of its use by its customer.

In the context of software engineering, software quality refers to two related but distinct
notions that exist wherever quality is defined in a business context: Software functional quality
reflects how well it complies with or conforms to a given design, based on functional
requirements or specifications. That attribute can also be described as the fitness for purpose
of a piece of soft- ware or how it compares to competitors in the market place as a worthwhile
product; Software structural quality refers to how it meets non-functional requirements that
support the delivery of the functional requirements, such as robustness or maintainability, the
degree to which the software was produced correctly.

Dept of ISE, NHCE Page 86


CROP YIELD PREDICTION

In the context of software engineering, software quality refers to two related but distinct
notions that exist wherever quality is defined in a business context: Software functional quality
reflects how well it complies with or conforms to a given design, based on functional
requirements or specifications. That attribute can also be described as the fitness for purpose
of a piece of soft- ware or how it compares to competitors in the market place as a worthwhile
product; Software structural quality refers to how it meets non-functional requirements that
support the delivery of the functional requirements, such as robustness or maintainability, the
degree to which the software was produced correctly.

Structural quality is evaluated through the analysis of the software inner structure, its source
code, at the unit level, the technology level and the system level, which is in effect how its
architecture adheres to sound principles of software architecture outlined in a paper on the
topic. In contrast, functional quality is typically enforced and measured through software
testing. Historically, the structure, classification and terminology of attributes and metrics
applicable to software quality management have been derived or extracted from the ISO 9126-
3 and the subsequent ISO 25000:2005 quality model, also known as square. Based on these
models, the Consortium for IT Software Quality(CISQ) has de- fined five major desirable
structural characteristics needed for a piece of software to provide business value: Reliability,
Efficiency, Security, Maintainability and (adequate) Size.

Software quality measurement quantifies to what extent a software or system rates along each
of these five dimensions. An aggregated measure of software quality can be computed through
a qualitative or a quantitative scoring scheme or a mix of both and then a weighting system
reflecting the priorities. This view of software quality being positioned on a linear continuum is
supplemented by the analysis of ”critical programming errors” that under specific
circumstances can lead to catastrophic outages or performance degradations that make a given
system unsuitable for use regardless of rating based on aggregated measurements.

Dept of ISE, NHCE Page 87


CROP YIELD PREDICTION

Such programming errors found at the system level represent up to 90 percent of production
issues, whilst at the unit-level, even if far more numerous, programming errors account for less
than 10 percent of production issues. As a consequence, code quality without the context of
the whole system, as W. Edwards Deming described it, has limited value.

To view, explore, analyze, and communicate software quality measurements, concepts and
techniques of information visualization provide visual, interactive means useful, in particular, if
several software quality measures have to be related to each other or to components of a
software or system.

Summary

The chapter discusses the tests that are done on the system to check its functionality. Testing is
carried out at three different levels from the module level to the system level checking for errors
at each stage. The remarks have also been documented.

Dept of ISE, NHCE Page 88


CROP YIELD PREDICTION

Chapter 7

EXPERIMENTAL RESULTS

Experimental Results

For every system, its efficiency and accuracy is important. Similarly in our sys- tem accuracy is
the key feature to judge the correctness of the model. In our model, we considered Mysore
region with average minimum and maximum temperature, average rainfall, and average
minimum and maximum pressure datasets. We considered data points of all the above
parameters for 1997 to 2014. In this 1997 to 2010 data points considered as training sets and
2011-2014 data points as testing sets. With these by using ”Multiple Linear Regression
algorithm” we have evaluated the accuracy for Rice, Ragi and Sugarcane crops. The accuracy for
seasonal crops (Rice and Ragi) using our model we observed as follows:

– Ragi - 93.39%

– Rice - 91.55%

Similarly when we applied our model on yearly crop-Sugarcane and observed accuracy of
72.17%. We observed little less accuracy for yearly crop since we had less data points available for
this crop. The results of every predicted crop graph is included in the appendix.

Dept of ISE, NHCE Page 89


CROP YIELD PREDICTION

Chapter 8

CONCLUSION AND FUTURE SCOPE

8.1 Conclusion

Developed Model for Crop Yield Prediction is able to predict the yield for crops like Ragi, Rice, and
Sugarcane in Mysore region. Based on our analysis, model will be more accurate if the more
datasets are available. So as the data point increases our system will become more and more
accurate. Our system accuracy is more than the existing system. Since we are displaying the
results in the form of graph with actual and predicted in the graphical user interface it is easy to
compare the previous year’s data. This model will help farmers to grow the crop which will give
more yield so that it will be more profitable.

8.2 Future scope

The developed model is has data points from 1997 to 2014 of Mysore region. It is giving
accuracy around 92% for seasonal and 72% for yearly crops. In future, this model can be
implemented throughout the India by adding the data points for all the region. According to our
analysis model will give more accuracy as the data points increases, so to get better accuracy
model data points can be increased. Our system can be integrated with messaging module so
that registered farmers can get the notification of the prediction directly to their registered
mobile numbers.

Dept of ISE, NHCE Page 90


CROP YIELD PREDICTION

REFERENCES

1) About Datasets on google


http://en.google.org/waterpool.com
2) About Datasets on google
https://data.gov.in/
3) For report
http://www.sharelatex.com
https://getbootstrap.com/docs/3.3/getting-started/

4) https://docs.angularjs.org/guide/concepts

5) https://www.analyticsvidhya.com/blog/2017/09/ common-machine-learning-algorithms/

6) https://flask-restful.readthedocs.io/en/latest/

7) Big Data Aalytics Architecture for Argo Advisory System.

8) Agriculture Yeild Prediction using predictive Analysis techinques.

9) An Efficient Analaysis of Crop Yeild Prediction using hadoop Framework Based on Random
Forest Approach

Dept of ISE, NHCE Page 91


CROP YIELD PREDICTION

SNAPSHOTS

Figure A.1: Sign up page

Figure A.2: Login page

Dept of ISE, NHCE Page 92


CROP YIELD PREDICTION

Figure A.3: Profile update page

Figure A.4: Datasets

Dept of ISE, NHCE Page 93


CROP YIELD PREDICTION

Figure A.5: Rice

Figure A.6: Sugarcane

Dept of ISE, NHCE Page 94


CROP YIELD PREDICTION

Figure A.7: Ragi

Figure A.8: About page

Dept of ISE, NHCE Page 95


CROP YIELD PREDICTION
ORIGINALITY REPORT

12 %
SIMILARITY INDEX
%
INTERNET SOURCES
12%
PUBLICATIONS
%
STUDENT PAPERS

PRIMARY SOURCES

Pariwat Ongsulee. "Artificial intelligence,


1
machine learning and deep learning", 2017 15th
2%
International Conference on ICT and Knowledge
Engineering (ICT&KE), 2017
Publication

Anand, Neetu. "Customized Category Based


2
Clustering of URLs", 2013 International
2%
Symposium on Computational and Business
Intelligence, 2013.
Publication

Yung-Hsing Peng, Chin-Shun Hsu, Po-Chuang


3
Huang. "Developing crop price forecasting
1%
service using open data from Taiwan markets",
2015 Conference on Technologies and
Applications of Artificial Intelligence (TAAI),
2015
Publication

Kalpesh Borse, Prasit G. Agnihotri. "Chapter 46


4
Prediction of Crop Yields Based on Fuzzy Rule-
1%
Based System (FRBS) Using the Takagi
Sugeno-Kang Approach", Springer Science and
Business Media LLC, 2019
Publication

"Advanced Computer and Communication


5
Engineering Technology", Springer Science and
1%
Business Media LLC, 2015
Publication

Purnima Shah, Deepak Hiremath, Sanjay


6
Chaudhary. "Big Data Analytics Architecture for
1%
Agro Advisory System", 2016 IEEE 23rd
International Conference on High Performance
Computing Workshops (HiPCW), 2016
Publication

"Machine learning and its algorithms: A


7
Research", International Journal of Innovative
<1%
Technology and Exploring Engineering, 2019
Publication

Sridevi M., Rajeshwara Rao R., Varaprasad


8
Rao M.. "chapter 6 Search Optimization to
<1%
Select an Item Across E-Commerce Platforms",
IGI Global, 2018
Publication

Jinshuo Liu, Yusen Chen, Lanxin Zhang, Juan


9
Deng, Weixin Zhang. "The Evaluation of the
<1%
Embedded Software Quality Based on the
Binary Code", 2016 IEEE International
Conference on Software Quality, Reliability and
Security Companion (QRS-C), 2016
Publication
<1%
10 Rashidah F. Olanrewaju, Thouhedul Islam, N.
Ali. "Chapter 40 An Empirical Study of the
Evolution of PHP MVC Framework", Springer
Science and Business Media LLC, 2015
Publication
<1%
11 Hassan Zahr, Hussein Al Haj Hassan, Jamal
Haydar. "Web-Based Framework for Assisting
Users Using Speech Recognition", 2018
International Arab Conference on Information
Technology (ACIT), 2018
Publication
<1%
12 David A. Ostrowski, Robert G. Reynolds.
"Chapter 5 Using Cultural Algorithms to Evolve
Strategies in A Complex Agent-based System",
Springer Science and Business Media LLC,
2005
Publication
<1%
13 B. Nithya, V. Ilango. "Predictive analytics in
health care using machine learning tools and
techniques", 2017 International Conference on
Intelligent Computing and Control Systems
(ICICCS), 2017
Publication
<1%
14 A. M. Sakkthivel, Ahmad Sharieh. "chapter 14
Promotion of Research Culture in Sur
University", IGI Global, 2014
Publication
<1%
15 J.Z. Gao, G. Durve, S. Alam, S. Shim. "Wireless
Based Multimedia Messaging System", The 8th
IEEE International Conference on E-Commerce
Technology and The 3rd IEEE International
Conference on Enterprise Computing, E-
Commerce, and E-Services (CEC/EEE'06),
2006
Publication
<1%
16 Salma Firdose, L. Manjunath Rao. "3LRM-3
Layer Risk Mitigation Modelling of ICT Software
Development Projects", International Journal of
Electrical and Computer Engineering (IJECE),
2016
Publication
<1%
17 Myat Myat Min, Khin Haymar Saw Hla. "Security
on Software Life Cycle using Intrusion Detection
System", 6th Asia-Pacific Symposium on
Information and Telecommunication
Technologies, 2005
Publication
<1%
18 Mark Robinson. "High Assurance BPEL Process
Models", High Assurance Services Computing,
2009
Publication
<1%
19 Xiaocong Fan. "Fundamental UML Structural
Modeling", Elsevier BV, 2015
Publication
<1%
20 Walid Fakhet, Salim El Khediri, Adel Dallali,
Abdennaceur Kachouri. "New K-means
algorithm for clustering in wireless sensor
networks", 2017 International Conference on
Internet of Things, Embedded Systems and
Communications (IINTEC), 2017
Publication
<1%
21 Chung-Yeung Pang. "chapter 4 Ten Years of
Experience with Agile and Model-Driven
Software Development in a Legacy Platform",
IGI Global, 2016
Publication
<1%
22 Pawarate Eiamboonsert, Sanhawat Taongern,
Wassmon Nuamsiri, Pagaporn Pengsart,
Pattanasak Mongkolwat. "dCollective: A
Configurable Electronic Data Collection Form
and Information Dashboard", 2018 15th
International Joint Conference on Computer
Science and Software Engineering (JCSSE),
2018
Publication
<1%
23 Purnima Shah, Deepak Hiremath, Sanjay
Chaudhary. "Towards development of spark
based agricultural information system including
geo-spatial data", 2017 IEEE International
Conference on Big Data (Big Data), 2017
Publication
24 Nan Li, Zetian Fu, Wengui Cai, Xiaoshuan <1%
Zhang. "Using Support Vector Machines to
Predict the Variation of Organic Pollutants in
Pond Water", Third International Conference on
Natural Computation (ICNC 2007), 2007
Publication

25 YongKang Xing, JiaPeng Huang, YongYao Lai. <1%


"Research and Analysis of the Front-end
Frameworks and Libraries in E-Business
Development", Proceedings of the 2019 11th
International Conference on Computer and
Automation Engineering - ICCAE 2019, 2019
Publication

26 P. Kumarapeli, S. De Lusignan, T. Ellis, B. <1%


Jones. "Using Unified Modelling Language
(UML) as a process-modelling technique for
clinical-research process improvement", Medical
Informatics and the Internet in Medicine, 2009
Publication

27 T. Evgeniou, M. Pontil, C. Papageorgiou, T. <1%


Poggio. "Image representations and feature
selection for multimedia database search", IEEE
Transactions on Knowledge and Data
Engineering, 2003
Publication

28 Dhivya Elavarasan, P. M. Durairaj Vincent.


"Crop Yield Prediction Using Deep
<1%
Reinforcement Learning Model for Sustainable
Agrarian Applications", IEEE Access, 2020
Publication

Exclude quotes Off Exclude matches Off


Exclude bibliography On

You might also like