Download as pdf or txt
Download as pdf or txt
You are on page 1of 55

A

Minor Project Report


on

AI BASED SOLUTION TO PREDICT


COTTON PRICE FOR SALE
Submitted in Partial Fullment of the Requirements for the Degree of

Bachelor of Engineering
in

Computer Engineering
to

Kavayitri Bahinabai Chaudhari North


Maharashtra University, Jalgaon

Submitted by
Gokul D. Bhoi
Shashwat A. Singh
Prathamesh R. Tayade
Akshay S. Wagh
Saurabh V. Wani
Under the Guidance of

Prof. Dr. Krishnakant P. Adhiya

DEPARTMENT OF COMPUTER ENGINEERING SSBT's


COLLEGE OF ENGINEERING AND TECHNOLOGY,
BAMBHORI, JALGAON - 425 001 (MS) 2020 - 2021
SSBT's COLLEGE OF ENGINEERING AND TECHNOLOGY,
BAMBHORI, JALGAON - 425 001 (MS)
DEPARTMENT OF COMPUTER ENGINEERING

CERTIFICATE

This is to certify that the minor project entitled AI BASED SOLUTION TO PRE-
DICT COTTON PRICE FOR SALE, submitted by

Gokul D. Bhoi
Shashwat A. Singh
Prathamesh R. Tayade
Akshay S. Wagh
Saurabh V. Wani

in partial fulfillment of the degree of Bachelor of Engineering in Computer Engineering


has been satisfactorily carried out under my guidance as per the requirement of Kavayitri
Bahinabai Chaudhari North Maharashtra University, Jalgaon.

Date: July 12, 2021


Place: Jalgaon

Prof. Dr. Krishnakant P. Adhiya


Guide

Prof. Dr. Girish K. Patnaik Prof. Dr. K. S. Wani


Head Principal

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) i


Acknowledgements

No work can be accomplished unless it has evolved as a result of co-operating, assistance and
understanding of some knowledgeable group of people. We take opportunity to thank our
Principal Prof. Dr. K. S. Wani Sir and Head of Department Prof. Dr. Girish K. Patnaik Sir
for providing all the necessary facilities, which were indispensable in the completion of
special study. We would like to thank our guide Prof. Dr. Krishnakant P. Adhiya Sir for
providing to be a great help by giving us guidance through their vast experience, intellectual
skills and also thankful to all the sta members of the Computer Engineering Department. We
would also like to thank the college for providing the required books, magazines and access
to the internet for collecting information related to the report. finally, We would like to thank
all of our parents.

Gokul D. Bhoi
Shashwat A. Singh
Prathamesh R. Tayade
Akshay S. Wagh
Saurabh V. Wani

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) ii


Contents

Acknowledgements ii

Abstract 1

1 Introduction 2
1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Problem Definition . .. . . . . .. . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Scope . . .. . . . . .. . . . . .. . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Objectives . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . 4
1.6 Selection of Life cycle model . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.7 Organization Of Report . . . . .. . . . . . . . . . . . . . . . . . . . . . . . 5
1.8 Summary . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . 7

2 Project Planning And Management 8


2.1 Feasibility Study . . .. . . . . .. . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.1 Economical Feasibility . .. . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.2 Operational Feasibility . .. . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.3 Technical Feasibility . . .. . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Risk Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3 Project Scheduling . .. . . . . .. . . . . . . . . . . . . . . . . . . . . . . . 10
2.4 Effort Allocation . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . 10
2.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Analysis 12
3.1 Requirement Collection and Identification . . . . . . . . . . . . . . . . . . . 12
3.1.1 Requirements Collection . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.2 Requirements Identification . . . . . . . . . . . . . . . . . . . . . . . 13
3.2 Software Requirements Specifications (SRS) . . . . . . . . . . . . . . . . . . 13
3.2.1 Product Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2.2 Operating Environment . . . . . . . . . . . . . . . . . . . . . . . . . 14

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) iii


3.2.3 Assumption . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . 15
3.2.4 Functional Requirements . . . . . . . . . . . .. . . . . . . . . . . . . 15
3.2.5 Non-Functional Requirements . . . . . . . . .. . . . . . . . . . . . . 15
3.2.6 External Interfaces (User, Hardware, Software, Communication) . . . 16
3.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4 Design 18
4.1 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.2 Data Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2.1 Level 0 DFD . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . 19
4.2.2 Level 1 DFD . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . 20
4.2.3 Level 2 DFD . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . 21
4.3 UML Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.3.1 Use Case Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.3.2 Sequence Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3.3 Collaboration Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3.4 Class Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.3.5 State Chart Diagram . . . . . . . .. . . . . . . . . . . . . . . . . . . 27
4.3.6 Component Diagram . . . . . . . .. . . . . . . . . . . . . . . . . . . 29
4.3.7 Deployment Diagram . . . . . . . .. . . . . . . . . . . . . . . . . . . 29
4.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

5 Implementation 31
5.1 Algorithm/Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.1.1 Flow Of System Development . . . . . . . . . . . . . . . . . . . . . . 31
5.1.2 Workflow . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . 32
5.2 Building Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.3 Software and Hardware for development in detail . . . . . . . . . . . . . . . 37
5.3.1 ImplementationEnvironment . . .. . . . . . . . . . . . . . . . . . . 37
5.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

6 System testing 39
6.1 Test cases and Test Results . . . . . . . .. . . . . . . . . . . . . . . . . . . 40
6.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

7 Result analysis 42
7.1 Model Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
7.2 Error Methods Result . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . 42
7.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) iv


8 Conclusion and Future Scope 45
8.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
8.2 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
8.3 Future Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) v


List of Tables

2.1 Effort Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.1 Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

6.1 Test Case:1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40


6.2 Test Case:2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.3 Test Case:3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

7.1 Actual vs. Predicted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) vi


List of Figures

1.1 Waterfall Model . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . .. . 5

2.1 Gantt Chart for Project Scheduling . . . . . . . . . . .. . . . . . . . . .. . 10

4.1 System Architecture . . . . . . . . . . . . . . . . . . .. . . . . . . . . .. . 19


4.2 Level 0 Data ow diagram . . . . . . . . . . . . . . . .. . . . . . . . . .. . 20
4.3 Level 1 Data Flow Diagram . . . . . . . . . . . . . . .. . . . . . . . . .. . 21
4.4 Level 2 Data FLow diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.5 Use Case Diagram . . . . . . . . . . . . . . . . . . . .. . . . . . . . . .. . 23
4.6 Sequence Diagram For Predicting Graph . . . . . . . .. . . . . . . . . .. . 24
4.7 Sequence Diagram For Showing Min Max Values . . . . . . . . . . . . . . . . 24
4.8 Collaboration Diagram For Sequence Diagram- Showing Prediction Graph . 25
4.9 Collaboration Diagram For Sequence Diagram- Showing Min Max Value . . 26
4.10 Class Diagram Of The Cotton Crop Prediction System . . . . . . . . . . . . . 27
4.11 State chart Diagram for the Processing Object . . . . . . . . . . . . . . . . . . . 28
4.12 Component Diagram Of The Cotton Crop Prediction System . . . . . . .. . 29
4.13 Deployment Diagram Of The Cotton Crop Prediction System . . . . . . ... 30

5.1 Flow Of System Development . .. . . . . . . . . . . . . . . . .. . . . ... 32


5.2 Production Year . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.3 Month . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.4 Cotton Variety . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . .. . 34
5.5 Linear Regression. . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . 36
5.6 Decision Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.7 Random Forest. . . . . . . . . . . . . .. . .. . . . . . . . . . . . . . . . . . . . . . 37
7.1 Metrics Table . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . 43
7.2 Actual Price Versus PredictedPrice . . . . . . . . . . . . . . . . . .. . . . . 43

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) vii


Abstract

Cotton is a global crop with high price uctuation, which depends on the global business
cycles. Many times, there are huge uctuations in the MSP of cotton but at the end of the
day, that diligent person has to su er who has worked hard every day in order to earn bread
for his family. Farmers here in India are very skilled in farming. They have well fertile land,
water and other necessary resources such as quality seeds and fertilizers, yet they're not paid
the amount they should get from brokers . The AI model is for predicting the cotton price
in upcoming months, which allows farmer to input the upcoming months and the model
predicts the price for sell of cotton. The basic functions of the model are that user can see price
trends, graphical representation of price, previous year's data .The Model will give rough idea
about MSP which helps Actor (Farmer) to think whether to rely on Cotton produce or not. As
there are no such prediction model available in market this will help customer to assess the
market with basic thought about MSP of cotton.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 1


Chapter 1

Introduction

Cotton is one of the most important fiber and cash crop of India and plays a Dominant role
in the industrial and agricultural economy of the country. It provides the Basic raw material
(cotton fiber) to cotton textile industry. Cotton in India provides direct Livelihood to 6 million
farmers and about 40-50 million people are employed in cotton Trade and its processing. In
India, there are ten major cotton growing states which are divided into three Zones, viz.
north zone , central zone and south zone . North zone consists of Punjab, Haryana, and
Rajasthan. Central zone includes Madhya Pradesh, Maharashtra and Gujarat. South zone
comprises Andhra Pradesh, Telangana, Karnataka and Tamil Nadu. Besides These ten
States, cotton cultivation has gained momentum in the Eastern State of Orissa. Cotton is also
cultivated in small areas of non-traditional States such as Uttar Pradesh, West Bengal &
Tripura. The discussion on forecasting, if it is possible at all and if so is the case, which
model would Yield the most accurate result, has been raging on in academic circles for
decades. The most Common case of forecasting studies concern ination, import- export trade
or yield due to their vast impact on the price of cotton and the importance to stabilize the
evolution of these Variables. In this project the goal is to find a model that can predict
future cotton prices with The help of econometric modelling. It must be stated that forecasting
is a very difficult task, proven through trial and error of academics and professionals
alike throughout the years.

1.1 Background
Indian economy is agro-based and agriculture is its mainstay as it constitutes the backbone of
the rural livelihood security system. Agriculture has been and still continues to be the life
line of the Indian economy since economic security is essentially predicted upon the
agricultural and allied sectors. The agriculture sector encompasses crop production, animal
husbandry, fisheries, agri-business, etc. Crop production depends upon crucial inputs such as
good seeds, fertilizers, pesticides, irrigation, human labour, machinery and management.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 2


A number of recently proposed techniques which predicts crop prices based on time series
analysis algorithm in which users are unable to give input to model. In such models it is
difficult for non-technical users to understand the procedure for checking predicted values for
crop prices. Time series analysis suffers from a number of weaknesses, including
problems with generalization from a single study, difficulty in obtaining appropriate
measures, and problems with accurately identifying the correct model to represent the data.
This Project tries to solve most of the problems specified above.

1.2 Motivation
Many times, there are huge fluctuations in the MSP of cotton but at the end of the day,
that diligent person has to suffer who has worked hard every day in order to earn bread
for his family. This kind of system needs to be changed and refreshed as it's been continuing
since the past 30-40 years. Farmers here in India are very skilled in farming. They have well
fertile land, water and other necessary resources such as quality seeds and fertilizers, yet they're
not paid the amount they should get from brokers (who acts as a middleman between
farmers and cotton mill). Cotton in India provides direct Livelihood to 6 million farmers and
about 40-50 million people are employed in cotton Trade and its processing. Sometimes
farmers may expect more price at time of cultivation/sowing than what they will get actually,
So it is important to have basic idea about what price they can expect at the time of
harvesting, So that they can decide whether to rely on production of cotton or produce some
other crop.

1.3 Problem Definition


In the current scenario , Farmers are not getting paid adequate amount by broker and
government system since there is huge uctuation in MSP of cotton farmer should be able to
get per unit. The AI model is for predicting the cotton price in upcoming months, which
allows farmer to input the upcoming months, state, variety and the model predicts the price for
sale of cotton .This information will also help them to assess how much profit they should
expect in upcoming future from cotton.

1.4 Scope
The AI model can be trained to predict the future cotton price. The price can be predicted
using various price determining factors like previous year price, Import-Export of cotton,
Production of cotton in particular year. The model can predict the Minimum selling price in
particular state.
SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 3
• The User/Farmer has to input Year for which he wants the expected future cotton
price

• User/Farmer would also be able to see the past year cotton price trends in various
graphical forms

• This information would help him to assess the future market trends beforehand

• User/Farmer can also see the minimum and maximum price of variety in particular
month

• User/Farmer can also download data file which includes actual and predicted price of
previous months

1.5 Objectives
The proposed project is designed to build platform for farmers to give rough idea about price of
cotton in upcoming months. The objectives of this project are as follows:

• To solve the crop value prediction problem in an effcient way to ensure the better price
to the farmers for sale of cotton.

• To provide user friendly GUI.

• To provide effcient way of data visualization for non-technical users.

• To help farmers to assess the future market trends beforehand.

1.6 Selection of Life cycle model


The software development life cycle model selected for this project is the Waterfall Model.
Waterfall approach was the first SDLC (Software Development Life Cycle) Model to be
widely used in software engineering to ensure success of the project. It was developed by
Winston W. Royce in 1970. In "The Waterfall" approach, the whole process of software
development is divided into separate phases, typically the outcome of one phase acts as the
input for the next phase sequentially. All the phases are cascaded to each other in which
progress is seen as owing steadily downwards (like a waterfall) through the phases. Re-
quirements for this project are well documented and fixed.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 4


Figure 1.1: Waterfall Model

Waterfall Model is best suited model for this project.

1. Because requirements are easily understandable and defined

2. We can define requirement in early stage of development

3. User involvement in all phases is not necessary

4. Limited user's participation

1.7 Organization Of Report


Chapter 1: Introduction This section should provide a general introduction of the
project being submitted and shall include write up on: the history of cotton, its
Background in Indian economy, the reason and Purpose of this project, the Project
Definition, Scope, the Objectives to be achieved, selection of Life Cycle Model on the basis
of analysis of gathered requirements, users' participation, etc.

Chapter 2: Project Planning and Management This section includes the Feasibility Study
that summarizes results of the analysis and evaluations conducted to review the proposed

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 5


solution and for the purpose of identifying if the project is really feasible, cost-effective and
profitable. Risk analysis could include legal/contractual risks, environmental risks, revenue
risks, project management risks, regulatory risks etc. A project schedule communicates what
tasks need to get done and which organizational resources will be allocated to complete those
tasks in what timeframe. The Gantt chart shows the project scheduling details and the e ort
allocation among the participants. This chapter also contains the cost estimation analysis
focus on the cost estimates, budget for the project, and means of financing and phasing of
expenditure.

Chapter 3: Analysis This chapter focuses on the gathering of requirements/data and their
identification. The Software Requirements Specification (SRS) document lists sufficient
and necessary requirements, functional and non-functional requirements, their operating
envi- ronment, product features, etc. For the project development.

Chapter 4: Design This chapter contains important aspects like the System Architecture,
Data Flow Diagrams (DFDs), UML diagrams which contains the Blueprints of the system.
They highlight the architecture, flow and sequential execution of the events.

Chapter 5: Implementation This chapter presents ow of system development, imple-


mentation details, implementation Environment used for project development.

Chapter 6: System Testing This chapter presents how to perform testing, strategy for
testing conventional software, test cases which performed on developed system to determine
system works properly

Chapter 7: Result analysis This chapter resents perturbation methods Result analysis with
existing methods, which proves that proposed mechanism gives very high performances and low
error rate compared with existing methods.

Chapter 8: Conclusion and Future Scope The Conclusions section sums up the key
points of the discussion/Project, the essential features of the design, or the significant
outcomes of the investigation. Also, bibliography, index and appendix.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 6


1.8 Summary
This project "AI based solution to predict the cotton price for sale" is used to predict the
cotton price in near future in particular state. This model uses the dataset of - sale price of
cotton in previous years, production of cotton per year, Import/Export of cotton, Production of
cotton in each state. This model will provide some resulting price for cotton in near future using
the previous year's data and some other factors a ecting price of cotton which helps farmers to
have certain thoughts about the upcoming possible price for cotton. This project model tries to
solve the crop value prediction problem in an efficient way to ensure the better price to
the farmers for sale of cotton.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 7


Chapter 2

Project Planning And Management

2.1 Feasibility Study


The feasibility study is carried out to test whether the proposed system is worth being
implemented. Feasibility study is a test of system proposed regarding its work ability, its
impact on the organization ability to meet user needs and effective use of resources. The
key consideration involve in the feasibility study are:

• Economic Feasibility

• Operational Feasibility

• Technical Feasibility

2.1.1 Economical Feasibility


This is the main factor in the feasibility study. When product is economically a ordable then it
can be used. So project must be cost saving. Establishing the cost effectiveness of the
proposed system.

The project relies on browser-based interface for end user inputs. Since the interface is
completely browser based it doesn't require bandwidth allocation and thus reduces the
financial aspect of project implementation. The project requires some software and tools
which follow freeware software standards and the dataset, we are using for the project is also
freely available thus giving an edge for developers' perspective and as well as for
customer's point of view as this would be a freeware.

2.1.2 Operational Feasibility


Operational feasibility is the ability to utilize, support and perform the necessary tasks of a
system or program. It includes everyone who creates, operates or uses the system.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 8


Provide summary statistical information without disclosing individual's confidential data. This
makes the system operationally feasible.

The prediction model which we will be develop- ing will be completely based on Machine
Learning for accurate prediction of cotton price; though technical skills are required for
proper implementation and synchronization of freely available tools. The product we are
developing is farmer beneficiary, Keeping this thing in mind we are developing a
browser-based client which would be freely available for farmers thus this will be directly
beneficial for our society.

2.1.3 Technical Feasibility


This assessment is based on an outline design of system requirements, to determine whether the
company has the technical expertise to handle completion of the project. Technical
feasibility involves the evaluation of the hardware, software, and other technical requirements of
the proposed system.

This portal is developed using development technologies such as Django, MySQL,


Html, CSS, Bootstrap,JS and Python. All the required hardware and software are
easily available in the market. Hence the portal is technically feasible. There is
no more hardware required other than personal system.

2.2 Risk Analysis


Risk analysis and management are a series of steps that help a software team to understand and
manage uncertainty. Many problems can plague a software project. A risk is a potential problem
might happen, it might not. But, regardless of the outcome, it is really a good idea to
identify it, assess its probability of occurrence, estimate its impact, and establish a
contingency plan should the problem actually occur.
The AI prediction model solely depends on dataset used and algorithm used so the
model may or may not give the best prediction. Also, the dataset used must be
accurate and consistent.
There is some probability in future that natural calamities may occur or who knows
about the unlikely events that may occur. As this Prediction Model is completely dataset-
based, it will be a huge drawback in order to predict MSPs in such cases. As this project
doesn't consider these types of events. The price predicted is totally dependent on quality of
cotton. So, if the quality of cotton varies the price for sale of cotton may vary accordingly.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 9


As there are huge number of factors which may affect the rate of cotton production, considering
each factors' data for prediction model is practically not possible.Also, it's impossible to consider
every factor which a ects cotton growth. Thus, keeping these things in mind the Prediction Model's
dataset depends on certain datasets which is freely available and can help in accurate prediction of
cotton price in most of the cases.

2.3 Project Scheduling


Software project scheduling is an activity that distributes estimated effort across the
planned project duration by allocating the effort to specific software engineering tasks. It is
important to note, however, that the schedule evolves over time. During early stages of
project planning, a macroscopic schedule is developed. The schedule identities all major
software engineering activities and the product functions to which they are applied. As
the project gets under way, each entry on the macroscopic schedule is refined into a detailed
schedule.

Figure 2.1: Gantt Chart for Project Scheduling

2.4 Effort Allocation


Project means team work, Project is developed by combination of e ort of team. So whole
project is divided into modules and number of modules is allotted to team members.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 10


Table 2.1: Effort Allocation

2.5 Summary
The Project is henceforth, feasible to use as its being developed primarily for Cotton pro-
ducing farmers which would lead in Direct Economic Boost and will strengthen the Base
Pillars of Our Society. Though there are some factors which can't be considered for AI
Prediction Model for e.g. Pesticides used per unit, amount of water used for cultivation of
cotton, natural- calamities, etc.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 11


Chapter 3

Analysis

3.1 Requirement Collection and Identification


Requirement collection is the process which is used to gather, analyze, and documentation
and reviews the requirements. Requirements describe what the system will do in place of
how.

3.1.1 Requirements Collection


Requirement Elicitation has been done by interviewing the main Actor (Farmer) and made
some conclusions about factors affecting the price of the cotton. But it is not practically
possible to comprise all the factors concluded from the conversation because of unavailability of
data for certain factors.
Interview With Actor(Farmer):-
After Interviewing Actor(Farmer) some of the concluded factors affecting price of cotton
are:

• Previous year's price of cotton in particular state

• Import/Export of cotton

• Production of cotton in State/Country

• Weather Factor

• Quality of cotton

• Natural Calamities,etc.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 12


3.1.2 Requirements Identification
1. Data
This model required proper dataset with consistent values. Also model may not rely on
only one factor. So this model requires dataset of various factors a ect the price of cotton
such as

• Previous year's price of cotton in particular state


• Each node is a router.
• Import/Export of cotton
• Production of cotton, etc.

2. Functional

• Authentication
• Input Data
• Predicted Data
• View Data

3. Behavioural

This model have to meet the accuracy for better prediction, User friendly interface so that
non-technical users can also use the website effciently.

• Accuracy

• User Friendly

3.2 Software Requirements Specifications (SRS)


It provides requirements, needs of project and those things which help to complete project.
System requirement describe a system from a technical perspective, which describe the es-
sential characteristics of the hardware and software that will meet those needs. It should
specify the capabilities, capacities and characteristics of the system in both qualitative and
quantitative terms.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 13


3.2.1 Product Feature
• Actor(Farmer) will get rough idea about the MSP(Minimum Selling Price) about cotton
in near future:-
This Model will give rough idea about MSP which helps Actor (Farmer) to think
whether to rely on Cotton produce or not. As there are no such prediction model
available in market this will help customer to assess the market with basic thought
about MSP of cotton.

• Graphical Representation of previous year's market trend of cotton prices:- Graphical


representation of data is the simplest way for any non- technical user to understand
insights of data. Graphical representation more effective than textual information. To
understand data insights from data is less time consuming than finding data insights from
textual format.

• Prediction of cotton prices:-


This model uses more than one factor for prediction of cotton price so that accuracy of
the model is better than any normal prediction model. Farmers and other users this model
make good business decision by using this model.

• Download actual and Predicted price:-


Users can download previous months actual prices and predicted prices so that they can
understand the accuracy of the model and they can decide to which extend they can
depend on this prediction model.

• Min-max Price:-
Users can see the expected(predicted) Min- Max price of variety in particular month.

3.2.2 Operating Environment


The software will operate within the following environment:

• Operating System: Windows 7 or later/Linux/MacOS

• Any browser supporting HTML5 and JavaScript

• Any system with at least 2GB RAM

• System with processor Intel Pentium 4 or later

• Google chrome recommended web browser for use of website

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 14


3.2.3 Assumption
• The variables (Factors) used for prediction will greatly affect prediction price of
cotton.

• The collected data used for prediction is presumed to be consistent.

• All of the equipment will be in working condition throughout project lifecycle.

• Team member will have gained all required skills before implementation phase.

• The team will have to use available open source resources.

• Milestones must be achieved within the estimated time.

3.2.4 Functional Requirements


Functional requirements are the functions which are expected from the software or platform.
Functional requirements along with requirement analysis help identify missing requirements.
They help clearly define the expected system service and behavior.
Table 3.1 shows functional requirement for this project.

FR.NO. Functional Requirement Functional Requirement Description


FR1 Input Data User should able to input the required input data
FR2 Predict Data Predict the price using model by using input of user
FR3 View Data User should able to select format of output data required
FR4 View Data options User will get options for output Graphical data (Bar
Graph,Line Graph)
FR5 Download Data User will get option for downloading data of previous
months which contains predicted and actual prices
FR6 Min-Max Price User will be able to see Min-Max expected price of variety
in upcoming month

Table 3.1: Functional Requirements

3.2.5 Non-Functional Requirements


Non-functional Requirement is mostly quality requirement. That stipulates how well the
portal does, what it has to do. Other than functional requirements in practice, this would
entail detail analysis of issues such as availability, security, usability and maintainability.
Non-functional requirements are as follows:

• RESPONSE TIME : The purpose of identifying response time is to highlight perform of


new website .Normal customer response shall be less than 5 sec for all website.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 15


• Workload : The new website must support 100 people at any given time and it might
double traffic volume in upcoming days.

• Security: The main security concern is for users account that's why Login mechanism
should be used to avoid unauthorized access.

• Safety: Information transmission should be securely transmitted to server without any


changes in information.

• Availability: If the internet service gets disrupted while sending information can be
send again for verification.

• Usability: As the system is easy to handle and navigates in the most expected way
with no delays. In that case the system program reacts accordingly and transverses
quickly between its states.

3.2.6 External Interfaces (User, Hardware, Software, Communication)


User interface
• User Login : At this page customer provide their credentials and get access.
If use provide wrong credentials then system will show alert message.
• Home Page : The homepage is design with colorful interface and intuitive layout for
easy navigation so that even non-technical person can easily navigate through the
website. Also the homepage will be user friendly and on homepage user will provide
the input in the form of expected year, state to calculate proper price prediction.

• Select Year: This Allows user to input the year for which he wants to predict cotton
price.

• Select State: This Allows user to input the state for which he wants to predict cotton
price.

• Select Month: This Allows user to input the state for which he wants to predict cotton
price.

• Select Variety: This Allows user to input the state for which he wants to predict cotton
price.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 16


Hardware interface
It is web based product. The hardware on which it resides will be any computer can have
internet.
The hardware requirement includes a system with following configurations:
• Processor: Intel Pentium or above
• RAM: 1 GB
• Input device: Standard Keyboard and Mouse
• Output device : VGA and High Resolution Monitor

Software interference
This project is web based model so only browser with internet connection is required from
user standpoint. This product will utilize various software components for its web based
functionality. Web server require to host website from developers' standpoint.

• Frontend: HTML, CSS, JS


• Backend: Django
• Database: MySQL

Communication interfaces

As a part of its core functionalities this product will require HTTP OR HTTPS communica-
tion interface with client device. It will also require to communicate with SQL DATABASE.

3.3 Summary
This Model will give rough idea about MSP which helps Actor (Farmer) to think whether to
rely on Cotton produce or not. The Software Requirements Specification (SRS) document
lists sufficient and necessary requirements, functional and non-functional requirements, their
operating environment, product features, etc. for the project development. This chapter
specifies Structure and Behavior of project.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 17


Chapter 4

Design

System design provides the understanding and procedural details necessary for implementing the
system. Design is an activity concerned with making major decisions, often of a structural nature.
Design builds coherent, well planned representations of programs that concentrate on the
interrelationships of parts at the higher level and the logical operations involved at the lower
levels. Software design is the first of the three technical activities designs, coding and test
which are required to build and verify the software.

4.1 System Architecture

The System Architecture provides the details of how the components or modules are integrated.
Figure 4.1 is indicating the system architecture of the Cotton price predicting model. This
architecture will give complete description of input and outputs of each process.

A system architecture is the conceptual model that defines the structure, behavior, and more
views of a system. An architecture description is a formal description and representation of a
system, organized in a way that supports reasoning about the structures and behaviors of the
system.

A system architecture can consist of system components and the sub-systems developed, that will
work together to implement the overall system. There have been efforts to formalize languages to
describe system architecture, collectively these are called architecture description languages.

The purpose of system architecture activities is to define a comprehensive solution based on


principles, concepts, and properties logically related to and consistent with each other.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 18


Figure 4.1: System Architecture

4.2 Data Flow Diagram


A data flow diagram (DFD) is a graphical representation of the `flow' of data through an
information system, modelling its process aspects. A DFD is often used as a preliminary
step to create an overview of the system, which can later be elaborated. DFDs can also be
used for the visualization of data processing (structured design). A DFD shows what kind of
information will be input to and output from the system, where the data will come from and
go to, and where the data will be stored.

4.2.1 Level 0 DFD

Level 0 contains one input and one output. The system provides information to the user
means system is input and the user is output. Figure 4.2 shows Level 0 DFD of project.

It is also known as a context diagram. It’s designed to be an abstraction view, showing the system
as a single process with its relationship to external entities. It represents the entire system as a
single bubble with input and output data indicated by incoming/outgoing arrows.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 19


Figure 4.2: Level 0 Data ow diagram

4.2.2 Level 1 DFD

A level 1 DFD notates each of the main sub-processes that together form the complete
system. We can think of a level 1 DFD as an "exploded view" of the context
diagram. Figure 4.3 shows Level 1 DFD of project.

In 1-level DFD, the context diagram is decomposed into multiple bubbles/processes.

The Level 0 DFD is broken down into more specific, Level 1 DFD. Level 1 DFD depicts basic
modules in the system and flow of data among various modules. Level 1 DFD also mentions
basic processes and sources of information. It provides a more detailed view of the Context Level
Diagram.

Here, the main functions carried out by the system are highlighted as we break into its
sub-processes.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 20


Figure 4.3: Level 1 Data Flow Diagram

4.2.3 Level 2 DFD

A level 2 data flow diagram offers a more detailed look at the processes that make up an
information system than a level 1 DFD does. It can be used to plan or record the specific
makeup of a system. Figure 4.4 shows Level 2 DFD of project.

Level 2 DFD contains six processes, three external entities, and one data stores.User can see
predicted value of cotton variety, graphical representation of price trends for cotton prices of
previous years, tabular representation of the minimum and maximum predicted price for cotton
monthwise. It helps users to find out which variety is giving maximum and minimum price in
particular month, User can download data file and get help by visiting help page.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 21


Figure 4.4: Level 2 Data ow diagram

4.3 UML Diagrams


The UML is a language for:

• Visualizing:-The structures which are transient can be represented using the UML

• Specifying:-The UML addresses the specification of all the important analysis, de-
sign and implementation decisions that must be made in developing and deploying a
software-intensive system

• Constructing:-The UML is not a visual programming language, but its models can be
directly connected to a variety of programming languages

• Documenting:-The UML addresses the documentation of a system's architecture and all


of its details

4.3.1 Use Case Diagrams


Use case diagram shows the interaction between Use case which represents system function-
ality and actor which represent the people or system.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 22


Figure 4.5: Use Case Diagram

4.3.2 Sequence Diagrams

Sequence diagrams are sometimes called event diagrams or event scenarios. A sequence
diagram shows, as parallel vertical lines (lifelines), different processes or objects that
live simultaneously, and, as horizontal arrows, the messages exchanged between them, in
the order in which they occur. Figure 4.6, 4.7, 4.8 shows sequence diagram for Use cases.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 23


Figure 4.6: Sequence Diagram For Predicting Graph

Figure 4.7: Sequence Diagram For Showing Min Max Values

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 24


4.3.3 Collaboration Diagrams
The collaboration diagram is used to show the relationship between the objects in a system.
Both the sequence and the collaboration diagrams represent the same information but dif-
ferently. Instead of showing the flow of messages, it depicts the architecture of the
object residing in the system as it is based on object-oriented programming. An object
consists of several features. Multiple objects present in the system are connected to each
other. The collaboration diagram, which is also known as a communication diagram, is used
to portray the object's architecture in the system. Figure 4.9, 4.10, 4.11 shows Collaboration
diagram for Use cases

Figure 4.8: Collaboration Diagram For Sequence Diagram- Showing Prediction Graph

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 25


Figure 4.9: Collaboration Diagram For Sequence Diagram- Showing Min Max Value

4.3.4 Class Diagram

In software engineering, a class diagram in the Unified Modelling Language (UML) is a


type of static structure diagram that describes the structure of a system by showing the
system's classes, their attributes, operations (or methods), and the relationships among
objects. Figure 4.12 shows class diagram for this project.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 26


Figure 4.10: Class Diagram Of The Cotton Crop Prediction System

4.3.5 State Chart Diagram


A state chart diagram, also known as a state machine diagram or state chart diagram, is an
illustration of the states an object can attain as well as the transitions between those states in
the Unified Modelling Language (UML). Figure 4.13 shows State chart Diagram.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 27


Figure 4.11: State chart Diagram for the { Processing Object

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 28


4.3.6 Component Diagram
A component diagram, also known as a UML component diagram, describes the organization
and wiring of the physical components in a system. Component diagrams are often drawn to
help model implementation details and double-check that every aspect of the system's
required functions is covered by planned development. Figure 4.14 shows component diagram for
cotton crop price prediction system.

Figure 4.12: Component Diagram Of The Cotton Crop Prediction System

4.3.7 Deployment Diagram


A deployment diagram is a UML diagram type that shows the execution architecture of a
system, including nodes such as hardware or software execution environments, and the mid-
dleware connecting them. Deployment diagrams are typically used to visualize the physical
hardware and software of a system. Using it you can understand how the system will be
physically deployed on the hardware. Figure 4.15 shows deployment diagram for cotton price
prediction model.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 29


Figure 4.13: Deployment Diagram Of The Cotton Crop Prediction System

4.4 Summary
This chapter contains important aspects of Designing of Model like the System Architecture,
Data Flow Diagrams (DFDs), UML diagrams which contains the Blueprints of the system.
They highlight the architecture, ow and sequential execution of the events. As Designing is
one of the most important process for building a project and which also helps in coding
phase .UML diagrams are useful for understanding features of project (Model)

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 30


Chapter 5

Implementation

Implementation of the proposed system involves the environment in which the system is
implemented and the overall system development. The overall development of the proposed
system requires suitable environment and proper resources for its successful completion.
Implementation of proposed system consists of various techniques and algorithms. Section5.1
talks about the Algorithms used in model building. The implementation details is discussed in
Section5.2. Section5.3 discusses about the software and hardware development in details and
finally the overall summary is discussed in Section5.4.

5.1 Algorithm/Steps
Random Forest algorithm steps:

1. Randomly select "k"features from total "m"features. Where k << m

2. Among the "k" features, calculate the node "d" using the best split point.

3. Split the node into daughter nodes using the best split.

4. Repeat 1 to 3 steps until "l" number of nodes has been reached.

5. Build forest by repeating steps 1 to 4 for "n" number times to create "n" number of
trees.

5.1.1 Flow Of System Development


• Planning Phase: Requirements are gathered during the planning phase. Requirements like
BRS that is Business Requirement Specifications and SRS that is System Requirement
specifications.

• Risk Analysis: In the risk analysis phase, a process is undertaken to identify risk and
alternate solutions. A prototype is produced at the end of the risk analysis phase. If

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 31


any risk is found during the risk analysis then alternate solutions are suggested and
implemented.

• Engineering Phase: After data collection, data cleaning, data transformation, Ex-
ploratory data analysis and Building and training model. In the phase software is
developed, along with testing at the end of the phase. Hence the development and
testing is done in the phase.

• Evaluation phase: The phase allows the users to see the output (Predicted cotton
Price along with graphical view of trends of cotton prices) of the proposed system of
upcoming months.

Figure 5.1: Flow Of System Development

5.1.2 Worflkow
Building And Training Models
Correlation plots help explain the relationship of the factors with the target variable. Mag-
nitude of the correlation coefficient of 0 indicates that there is no correlation between the
selected attributes and a 1 indicates that the selected variables are at best correlated.

Identification of Features
After performing data exploration, some important features are selected for the modeling.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 32


Production Year
It is found that Cotton price has increased linearly over the past 10 years as shown in Figure
5.2. Hence production year plays important role in forecasting cotton price.

Month
In data exploration, it is observed that price of cotton also depends on Month of selling
cotton. Cotton is a kharif crop which requires 6 to 8 months to mature. In Punjab and
Haryana it is sown in April-May and is harvested in December-January. In the peninsular part
of India, it is sown up to October and harvested between January and May. Hence it is seen
price drop in cultivation months and price hike in harvesting months in Figure 5.3.

Variety
Cotton price majorly related to the variety of cotton. Variety producing long staple and good
quality cotton have high demand in the market and so the prices, but variety producing short
staple have less prices comparatively. Figure 5.4 shows this linear relation between variety of
cotton and price of cotton.

Figure 5.2: Production Year

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 33


Figure 5.3: Month

Figure 5.4: Cotton Variety

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 34


State
In India, cotton is grown in 9 major cotton growing States viz. Punjab, Haryana and
Rajasthan in Northern zone, Gujarat, Maharashtra and MP in Central zone and Andhra
Pradesh, Karnataka and Tamil Nadu in Southern zone. Besides, cotton is also grown in
Orissa.

5.2 Building Models


For continuous variable forecasting, regression algorithms are used such as:

• Linear Regression
Linear regression is useful for finding relationship between two continuous variables. One is
predictor or independent variable and other is response or dependent variable. It looks for
statistical relationship but not deterministic relationship. Relationship between two variables is
said to be deterministic if one variable can be accurately expressed by the other.
It models the linear relationship between dependent and independent variables. A
linear regression line has an equation of the form y = a + bX.
Where X is the explanatory variable and Y is the dependent variable. The slope of the
line is b, and a is the intercept (the value of y when x = 0). The value of a and b
calculated by Gradient Descent Algorithm. Feature used: Production Year, Month,
Production, Variety, States, Districts, Import, Export, Import Value in RS.crores, Export
Value in RS. crores. Difference Between Actual Price And Predicted Price can easily be
seen in Figure 5.5.

• Decision Tree Regression


Decision Tree algorithm belongs to the family of supervised learning algorithms. Unlike other
supervised learning algorithms, the decision tree algorithm can be used for solving regression and
classification problems too.The goal of using a Decision Tree is to create a training model that
can use to predict the class or value of the target variable by learning simple decision rules
inferred from prior data(training data).In Decision Trees, for predicting a class label for a record
we start from the root of the tree. We compare the values of the root attribute with the record’s
attribute. On the basis of comparison, we follow the branch corresponding to that value and jump
to the next node.

SSBT's College of Engineering and Technology, Bambhori, Jalgaon (MS) 35


Decision Tree is a Supervised learning technique that can be used for both classification
and Regression problems, It is a treestructured classifier, where internal nodes represent the
features of a dataset, branches represent the decision rules and each leaf node represents the
outcome. Node splitting is done by comparing MSE(Mean Square Error) of Decision Node.
Nodes of Decision tree expanded until all leaves are pure. Feature used: Production
Year, Month, Production, Variety, Import, Export, Import Value in RS.crores, Export
Value in RS.crores. Figure 5.6 shows Actual price and Predicted Price using Decision Tree.

• Random Forest

Random Forest Regression is a supervised learning algorithm that uses ensemble learning
method for regression. For this ensemble model, 80 number of Decision Trees are used. Here
also MSE criteria are used to split the nodes.For selection of features, Bootstrap Technique is
used. Here also nodes of all Decision trees expanded until all leaves are pure. Feature used:
Production Year, Month, States, Variety. Figure 5.7 shows Actual price and Predicted Price
using Random Forest.

Random Forest is a popular machine learning algorithm that belongs to the supervised learning
technique. It can be used for both Classification and Regression problems in ML. It is based on
the concept of ensemble learning, which is a process of combining multiple classifiers to solve a
complex problem and to improve the performance of the model.

Figure 5.5: Linear Regression

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 36


Figure 5.6: Decision Tree

Figure 5.7: Random Forest

5.3 Software and Hardware for development in detail


The proposed system is developed using the Python, Django, Html, CSS and JS. The front- end
includes Html, CSS, JS and Python, Django is the back-end of the system.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 37


5.3.1 Implementation Environment

• Python:- Python is an interpreted high-level general-purpose programming language.


Python's design philosophy emphasizes code readability with its notable use of significant
indentation. Its language constructs as well as its object-oriented approach aim to help
programmers write clear, logical code for small and large-scale projects. NumPy, Pandas,
matplotlib, scikit-learn are most popular libraries in python used for machine learning.
NumPy is the fundamental package for scientific computing with Python. It mostly used for
solving matrix problems. Pandas is the most popular machine learn- ing library written in
python, for data manipulation and analysis. Matplotlib, a great library for Data
Visualization. Scikit-learn is one of the most popular ML libraries today. It supports most of
ML algorithms, both supervised and unsupervised: linear and logistic regression, Decision
tree, Random Forest, support vector machine (SVM), Naive Bayes classifier, gradient
boosting, k-means clustering, KNN, and many others.

• Django:- Django is a Python-based free and open-source web framework that followsthe
model template views architectural pattern. The Django web framework includes a default
object-relational mapping layer (ORM) that can be used to interact with application data
from various relational databases such as SQLite, PostgreSQL and MySql

5.4 Summary
In this chapter, the implementation details, implementation environment are described. In the
next chapter, System Testing is discussed.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 38


Chapter 6

System testing

Implementation of system testing is one of the important and difficult job and for testing
the system, there are various test cases which are applied and results are considered.
System testing is an empirical technical investigation conducted to provide stake
holders with information about the quality of the product or service under test, with respect
to the context in which it is intended to operate. This includes, but is not limited to,
the process of executing a program or application with the intent of finding errors. System
Testing is a set of activities that can be planned in advance and conducted systematically.
The proposed system is tested in parallel with the software that consists of its own phases of
analysis.
Following are the various types of testing:-

• Unit Testing:- Unit testing is a software development process in which the smallest
testable parts of an application, called units are individually and independently ex-
amined closely for proper operation. Unit testing can be done manually but is often
automated. During unit testing some errors were raised and all of them were rectified
and handled well. The result was quiet satisfactory and it worked well.

• Integration Testing:- Integration testing is the phase in software testing in which in-
dividual software modules are combined and tested as a group. It occurs after unit
testing and before validation testing. The system has been passed through the inte-
gration testing. The modules were combined and tested for their compatibility with
other modules. The test was almost successful. All the modules coexisted very well,
with almost no bugs.

• System Testing:- System testing of software or hardware is testing conducted on a com-


plete, integrated system to evaluate the system's compliance with its specified require-
ments. 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.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 39


• Black Box Testing:- Black box testing is a method of software testing that examines the
functionality of an application without peering into its internal structure or working. In
black box testing tester is aware of what the software is suppose to do but is not aware
of how it does it.

• White Box Testing:-It is software testing technique in which internal structure, design and
coding of software are tested to verify ow of input-output and to improve design, usability
and security. In white box testing, code is visible to testers so it is also called Clear box
testing, open box testing, transparent box testing, Code-based testing and Glass box
testing.

White box testing is done to find out the following information as shown in below:-

• Incorrect or missing functions

• To check ow of Input-output

• To improve design

• To check the usability

• Interface errors

• Errors or database access

6.1 Test cases and Test Results


Test case is the set of inputs along with the output and some additional information like:-
Following Table 6.1 depicts the test case for predicting cotton price for specific variety and
month, Table 6.2 depicts the test case for changing graphical view type. Table 6.3 depicts the
test case for viewing Min-max cotton price month wise.

Test Case - 1
Purpose: Predict Cotton Price
Pre-requisite: Django server status running, Required Input Fields occupied
Test data: To get Prediction page
Steps: Type the following on web browser http://localhost:127.0.0.1/
Expected result: Predicted price with graphical view of trends of cotton prices
Test Case Result: PASS

Table 6.1: Test Case:1

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 40


Test Case - 2
Purpose: changing graphical view
Pre-requisite: Django server status running, Required Input Fields occupied
Test data: To get Prediction page
Steps: Post request to http://localhost:127.0.0.1/prediction
Expected result: Graphical view should change
Test Case Result: PASS

Table 6.2: Test Case:2

Test Case - 3
Purpose: Min-Max cotton price month wise
Pre-requisite: Django server status running
Test data: To get MinMax page
Steps: Type the following on web browser http://localhost:127.0.0.1/MinMax
Expected result: View Min-Max Table
Test Case Result: PASS

Table 6.3: Test Case:3

6.2 Summary
In this chapter, the system testing details, testing environment are described. In the next
chapter, result and analysis are discussed.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 41


Chapter 7

Result analysis

The chapter describes the results obtained for proposed system. These results are
examined and analyzed to infer that they are according to the expected results or not.
Section 7.1 describes Models Analysis Result. Section 7.2 describes Error Methods
Result and Last Section 7.3 describes Summary.

7.1 Model Analysis

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 42


Table 7.1 Model Analysis

7.2 Error Methods Result


Various error methods are evaluated for every model and the accuracy are measured. Here, by applying
the models Linear Regression, Decision Tree and Random Forest the RMSE, MSE, MAE values and
their accuracy metrics are computed and stated in the Figure 7.1.

Figure 7.1: Metrics Table Figure 7.2: Actual Price vs. Predicted Price

Figure 7.2 shows difference between Actual price and Predicted price by Random Forest
Date State Variety Actual Price Predicted Price
June 2021 Gujrat shanker 6B 6140 6346.53
June 2021 Gujrat Narma BT 6088 6525.10
March 2021 Gujrat RCH2 5892.5 5765.37
June 2021 Karnatak LD327 5800 5702.08
May 2021 Karnatak suyodhar 5100 5117.26
May 2021 MP dch 32g 5000 5146.97
March 2021 Punjab narma bt 6090 6097.70
June 2021 Tamilnadu mcu 5 4950 5121.59

Table 7.3: Actual vs. Predicted

7.3 Summary
In this chapter, the result and analysis details, test cases and test results are described. In the
next chapter, Conclusion and Future Scope are discussed.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 44


Chapter 8

Conclusion and Future Scope

The most beneficiary of the proposed project is farmer and this project gives platform for
farmers to assess the future cotton price swing and fluctuations. The tools and technology
will be used in development and deployment phases are robust, exible and platform inde-
pendent. The proposed project will be accessible for all the actors after the
completion of implementation and testing phase.

8.1 Conclusion
Under trial and error method various models were fit to the dataset to find a best model for
cotton price prediction. It is found that the RANDOM FOREST model is the best fit with
80%.

8.2 Limitations
Since cotton price depends majorly on Natural conditions, mathematical algorithms cannot
accommodate that changes. Here is one special case: Case : 2010-11 Price hike Some of the
key reasons for the supply tightness was a shortfall in Chinese cotton crop, prolonged flood-
ing in the cotton growing areas of Pakistan and export restrictions imposed by the
Indian government in 2010. India had initially banned cotton exports in 2010, but
subsequently opened it up with restrictions. These subsequent events caused the highest
price hike of cotton in past 100 years. Some features are not included while building the
models due to unavailability of data Like Rainfall in specific regions, Political interference,
uncertain events like recent covid pandemic.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 45


8.3 Future Scope
This study can be strengthened by accommodating Region wise Rainfall Data, Global Market
Impact, Ination rate, Soil etc. Also study can be expanded by encompassing various crops and
their features to predict future prices. Future study can help farmers to choose which crop to
be cultivate in order to gain sufficient earning.

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 46


Bibliography
1] Sadiq A Mulla,Dr.S.A.Quadri “Crop-yield and Price Forecasting using Machine Learning”.

[2] “Agricultural Production Output Prediction Using Supervised Machine Learning Techniques”,
Md.TahmidShakoor, Karishma Rahman, SumaiyaNasrinRayta, Amitabha Chakrabarty,
2015IEEE.

[3] E. Manjula, S. Djodiltachoumy, “Analysis of Data Mining Techniques for Agriculture Data”, Int.
J. Comput. Sci. Eng. Comm, vol. 4, no. 2, pp. 1311–1313, 2016.

[4] Dahikar, S. S., Rode, S. V. (2014). Agricultural crop yield prediction using artificial neural
network approach. International journal of innovative research in electrical, electronics,
instrumentation and control engineering, 2(1),683-686.

[6] Carter, C. A., G. C. Rausser, Smith, A. (2011). Commodity Booms and Busts. Annual Review
of Resource Economics 3(1). 87-118.

[7]Carter C. A., Janzen J. P., (2009). The 2008 cotton price spike and extraordinary hedging
costs. ARE Update 13(2), 9–11.

[8] Baffes, J. (2011). Cotton Subsidies, the WTO, and the ‘Cotton Problem’. The World
Economy. Washington DC: World Bank.

[9]Baffes, J., and Haniotis, T., (2010). Placing the 2006/08 Commodity Price Boom into
Perspective. Working paper No. 5371.

Resources:
• https://cotcorp.org.in/statistics.aspx
• https://www.kaggle.com/krishrocks/cotton-india-production
• https://www.researchgate.net
• https://data.gov.in
• https://icar.org.in
• https://www.nabard.org
• https://www.nfsm.gov.in/BriefNote/BN_Cotton.pdf

SSBT’s College of Engineering and Technology, Bambhori, Jalgaon (MS) 18

You might also like