You are on page 1of 28

Project Documentation

Disease Prediction App

Submitted to:
Maam Amna Yasin

Submitted by:
Name: Saif Ul Rehman Roll NO : 18-CS-09

Name: Abdullah Shaihd Roll NO : 18-CS-04

Name: M.Umar Arif Roll NO : 18-CS-18

NFC Institute of Engineering

and Fertilizer Research,Faisalabad


ABSTRACT

Disease Prediction using Machine Learning is a system which predicts the disease based on the

information or the symptoms he/she enter into the system and provides the accurate results based

on that information. If the patient is not much serious and the user just wants to know the type of

disease, he/she has been through. It is a system which provides the user the tips and tricks to

maintain the health system of the user and it provides a way to find out the disease using this

prediction. Now a day’s health industry plays major role in curing the diseases of the patients so

this is also some kind of help for the health industry to tell the user and also it is useful for the

user in case he/she doesn’t want to go to the hospital or any other clinics, so just by entering the

symptoms and all other useful information the user can get to know the disease he/she is

suffering from and the health industry can also get benefit from this system by just asking the

symptoms from the user and entering in the system and in just few seconds they can tell the exact

and up to some extent the accurate diseases. This Disease Prediction Using Machine Learning is

completely done with the help of Machine Learning and Python Programming language for it

and also using the dataset that we will predict the disease.“Disease Prediction” app based on

predictive modeling predicts the disease of the user on the basis of the symptoms that user provides as an

input to the app. The app analyzes the symptoms provided by the user as input and gives the probability

of the disease as an output .Disease Prediction is done by implementing the Decision Tree

Algorithm.
Contents
Chapter No 1: INTRODUCTION ..................................................................................................................... 5
1.1 Introduction: ....................................................................................................................................... 5

1.2 Problem Statement: ............................................................................................................................ 5

1.3 Objective: ............................................................................................................................................ 5

1.3.1 General Objective: ....................................................................................................................... 5


1.3.2 Specific Objective: ........................................................................................................................ 5
1.4 Scope and Limitations: ........................................................................................................................ 6

1.4.1 Scope : .......................................................................................................................................... 6


1.4.2 Limitations: .................................................................................................................................. 6
CHAPTER 2: LITERATURE SURVEY ................................................................................................................. 7
2.1 MACHINE LEARNING ........................................................................................................................... 7

2.1.1 Categories: ................................................................................................................................... 8


2.1.2 FEATURES OF MACHINE LEARNING ............................................................................................. 8
Chapter 3: SOFTWARE REQUIREMENT SPECIFICATION .............................................................................. 10
3.1 Requirement Analysis ....................................................................................................................... 10

 Software Interface Requirements ............................................................................................... 10


3.1.2 Tools: .......................................................................................................................................... 10
3.1.3 Language: ................................................................................................................................... 10
3.1.4 Non-functional requirements .................................................................................................... 10
3.2 Feasibility Analysis ............................................................................................................................ 11

3.2.1 Technical feasibility .................................................................................................................... 11


3.2.2 Economic feasibility ................................................................................................................... 11
CHAPTER 4: DESIGN AND ANALYSIS............................................................................................................ 12
3.1 Methodology ..................................................................................................................................... 12

3.2 Data collection .................................................................................................................................. 12

3.3 Algorithm implemented .................................................................................................................... 12


3.3.1 Decision Tree Algorithm: ........................................................................................................... 12
3.4 Class Diagram .................................................................................................................................... 13

3.5 State diagram .................................................................................................................................... 13

3.6 Sequence diagram............................................................................................................................. 14

Chapter 5: IMPLEMENTATION .................................................................................................................... 15


5.1 OVERVIEW ......................................................................................................................................... 15

5.2 DECISION TREE ALGORITHM ............................................................................................................. 15

Chapter 6: Module & Features ................................................................................................................... 17


6.1 Patient Login: .................................................................................................................................... 17

6.2 Patient Registration: ......................................................................................................................... 17

6.3 Disease Prediction: ............................................................................................................................ 17

6.4 Feedback: .......................................................................................................................................... 17

6.5 Diseases Dictionary: .......................................................................................................................... 17

CHAPTER 7 : RESULTS(Snapshots) ............................................................................................................... 18


Chapter 8: Advantages & Disadvantages: ................................................................................................... 27
8.1 Advantages:....................................................................................................................................... 27

8.2 Disadvantages: .................................................................................................................................. 27

8.3 Future Work ...................................................................................................................................... 27

Chapter 9: Conclusion: ................................................................................................................................ 28


Chapter No 1: INTRODUCTION

1.1 Introduction:
At present, when one suffers from particular disease, then the person has to visit to doctor which
is time consuming and costly too. Also if the user is out of reach of doctor and hospitals it may
be difficult for the user as the disease can not be identified. So, if the above process can be
completed using a automated program which can save time as well as money, it could be easier
to the patient which can make the process easier.

There are other Heart related Disease Prediction App using data mining techniques that analyzes
the risk level of the patient.
Disease Predictor is a Mobile Application that predicts the disease of the user with respect to the
symptoms given by the user. Disease Prediction App has data sets collected from different health
related sites. With the help of Disease Predictor the user will be able to know the probability of
the disease with the given symptoms.

1.2 Problem Statement:


There are many tools related to disease prediction. But particularly heart related diseases have
been analyzed and risk level is generated. But generally there are no such tools that are used for
prediction of general diseases. So Disease Predictor helps for the prediction of the general
diseases.

1.3 Objective:

1.3.1 General Objective:


-To implement Decision Tree Algorithm that classifies the disease as per the input of the user.

1.3.2 Specific Objective:


-To develop web interface platform for the prediction of the disease.
1.4 Scope and Limitations:
1.4.1 Scope :
This project aims to provide a mobile app platform to predict the occurrences of disease on the
basis of various symptoms. The user can select various symptoms and can find the diseases with
their probabilistic figures.

1.4.2 Limitations:
The limitations of this project are:
 Disease Predictor does not recommend medications of the disease.
 Past history of the disease has not been considered
CHAPTER 2: LITERATURE SURVEY

2.1 MACHINE LEARNING


Tom Mitchell states machine learning as “A computer program is said to learn from experience
and from some tasks and some performance on, as measured by, improves with experience”.
Machine Learning is combination of correlations and relationships, most machine learning
algorithms in existence are concerned with finding and/or exploiting relationship between
datasets. Once Machine Learning Algorithms can pinpoint on certain correlations, the model can
either use these relationships to predict future observations or generalize the data to reveal
interesting patterns. In Machine Learning there are various types of algorithms such as
Regression, Linear Regression, Logistic Regression, Naive Bayes Classifier, Bayes theorem,
KNN (K-Nearest Neighbor Classifier),
Decision Tress, Entropy, ID3, SVM (Support Vector Machines), K-means Algorithm,
Random Forest and etc.,
The name machine learning was coined in 1959 by Arthur Samuel. Machine learning explores
the study and construction of algorithms that can learn from and make predictions on data
Machine learning is closely related to (and often overlaps with) computational statistics, which
also focuses on prediction-making through the use of computers. It has strong ties to
mathematical optimization, which delivers methods, theory and application domains to the field.
Machine learning is sometimes conflated with data mining, where the latter subfield focuses
more on exploratory data analysis and is known as unsupervised learning.
Within the field of data analytics, machine learning is a method used to devise complex models
and algorithms that lend themselves to prediction; in commercial use, this is known as predictive
analytics. These analytical models allow researchers, data scientists, engineers, and analysts to
"produce reliable, repeatable decisions and results" and uncover "hidden insights" through
learning from historical relationships and trends in the data.
Machine learning tasks Machine learning tasks are typically classified into several broad
2.1.1 Categories:
Supervised learning: The computer is presented with example inputs and their desired outputs,
given by a "teacher", and the goal is to learn a general rule that maps inputs to outputs. As
special cases, the input signal can be only partially available, or restricted to special feedback.
Semi-supervised learning: The computer is given only an incomplete training signal: a training
set with some (often many) of the target outputs missing.
Active learning: The computer can only obtain training labels for a limited set of instances
(based on a budget), and also has to optimize its choice of objects to acquire labels for.
When used interactively, these can be presented to the user for labelling.
Unsupervised learning: No labels are given to the learning algorithm, leaving it on its own to
find structure in its input. Unsupervised learning can be a goal in itself (discovering hidden
patterns in data) or a means towards an end (feature learning).
Reinforcement learning: Data (in form of rewards and punishments) are given only as feedback
to the program's actions in a dynamic environment, such as driving a vehicle or playing a game
against an opponent.

2.1.2 FEATURES OF MACHINE LEARNING

• It is nothing but automating the Automation.


• Getting computers to program themselves.
• Writing Software is bottleneck.
• Machine leaning models involves machines learning from data without the help of
humans or any kind of human intervention.
• Machine Learning is the science of making of making the computers learn and act like
humans by feeding data and information without being explicitly programmed.
• Machine Learning is totally different from traditionally programming, here
• data and output is given to the computer and in return it gives us the program
• which provides solution to the various problems. Below is the figure.

Machine Learning is a combination of Algorithms, Datasets, and Programs.


• There are Many Algorithms in Machine Learning through which we will provide
us the exact solution in predicting the disease of the patients.
Chapter 3: SOFTWARE REQUIREMENT SPECIFICATION

3.1 Requirement Analysis

3.1.1 Functional requirements


a. Predict disease with the given symptoms.
b. Compare the given symptoms with the input datasets

 Software Interface Requirements

Operating System:

 Android

3.1.2 Tools:
 Android Studio 4.1.1
 Visual Studio Code (IDE)
 Flutter 2.0.3
 PyCharm 2020.3.5
 Firebase

3.1.3 Language:
 Dart
 Python

3.1.4 Non-functional requirements

a. Display the list of symptoms where user can select the symptoms.
b. Decision Tree Algorithm is used to classify the data sets.
3.2 Feasibility Analysis

3.2.1 Technical feasibility


The project is technically feasible as it can be built using the existing available technologies. It is a
web based applications that uses Grails Framework. The technology required by Disease Predictor is
available and hence it is technically feasible.

3.2.2 Economic feasibility


The project is economically feasible as the cost of the project is involved only in the hosting of the
project. As the data samples increases, which consume more time and processing power. In that case
better processor might be needed.

3.2.3 Operational feasibility

The project is operationally feasible as the user having basic knowledge about computer and Internet.
Disease Predictor is based on client-server architecture where client is users and server is the machine
where datasets are stored
CHAPTER 4: DESIGN AND ANALYSIS

3.1 Methodology
Disease Prediction has been already implemented using different techniques like Neural Network,
decision tree and Naïve Byes algorithm. Particularly heart related disease is mostly analyzed. From
the analysis it was found that Naïve Bayes is more accurate than other techniques. So, Disease
Predictor also uses Naïve Bayes for the prediction of different diseases.

3.2 Data collection


Data collection has been done from the internet to identify the disease here the real symptoms of the
disease are collected i.e. no dummy values are entered. The symptoms of the disease are collected
from different health related websites.

3.3 Algorithm implemented


The algorithm implemented in this project is Decision Tree Algorithm

3.3.1 Decision Tree Algorithm:

It is a sort of supervised learning algorithmic program that's largely used for classification issues.
Surprisingly, it works for each categorical and continuous dependent variable. In this algorithmic
program, we tend to split the population into 2 or a lot of homogenized sets. This is done supported
most vital attributes/ freelance variables to form as distinct teams as attainable. A tree has several
analogies in real world, and seems that it's influenced a large space of machine learning, covering
each classification and regression. In call analysis, a choice tree is wont to visually and expressly
represent selections and higher cognitive process. As the name goes, it uses a tree-like model of
decisions. Though a commonly used tool in data mining for deriving a strategy to reach a particular
goal, it’s also widely used in machine learning. Once we completed modelling the Decision Tree
classifier, we will use the trained model to predict whether the balance scale tip to the right or tip
to the left or be balanced
3.4 Class Diagram

It explain the classes used in the Disease Predictor. There are three classes used in total, Symptoms
Reader: Reads the user input and creates the list of symptoms
Symptoms Analyzer: According to symptoms parameter displays the subjective result.
Calculate Values: Calculates the probabilistic model of the diseases.

3.5 State diagram


It explains different state of the system. First the user opens Disease Predictor. The user selects the
symptoms. When finished selecting symptoms the user submits the symptoms. Disease Predictor
analyzes the symptoms and displays the result.

3.6 Sequence diagram

It explains the sequence of the Disease Predictor. Initially system shows the symptoms to be selected.
The user selects the symptoms and submits to the system .The Disease Predictor predicts and display
the result
Chapter 5: IMPLEMENTATION

5.1 OVERVIEW
The project Disease Prediction using Machine Learning is developed to overcome general
disease in earlier stages as we all know in competitive environment of economic development
the mankind has involved so much that he/she is not concerned about health according to
research there are 40% peoples how ignores about general disease which leads to harmful disease
later. The Project “Disease Prediction using Machine Learning” is implemented using python
completely. Even the interface of this project is done using Flutter freamwork. Here first the user
needs to register into the system in order to use the prediction, user needs to register with
username, email-id, phone, age and password.

5.2 DECISION TREE ALGORITHM


Decision tree induction is the learning of decision trees from class-labelled training tuples.
A decision tree is a flowchart-like tree structure,

Decision tree induction is a non-parametric approach for building classification models.


• Finding an optimal decision tree is an NP-complete problem
• Techniques developed for constructing decision trees are computationally inexpensive,
making it possible to construct models even when the training set size is very large.
• Decision trees, especially smaller-sized trees, are relatively easy to interpret.
• Decision tree provide an expressive representation for learning discrete- valued functions.
• Decision tree algorithms are quite robust to the presence of noise, especially when
methods for avoiding overfitting.

Example:
Chapter 6: Module & Features

6.1 Patient Login:


User Login to the system using his Email and Password.

6.2 Patient Registration:


If User is a new user he will enter his personal details and he will user Id and

password through which he can login to the system.

6.3 Disease Prediction:


User will specify the symptoms caused due to his illness. System will ask

certain question regarding his illness and system predict the disease based on

the symptoms specified by the patient and system will also suggest doctors

based on the disease.

6.4 Feedback:
User will give feedback this will be reported to the admin.

6.5 Diseases Dictionary:


User can study and read all information (Like Introduction ,Causes,

Symptoms & Treatment) about different diseases.


CHAPTER 7 : RESULTS(Snapshots)

Splash Screen:
Login & Registration Screen:

Home Screen:
Search Diseases:
Diseases Result:

Diseases Dictionary:
All:

Fever & Typoid:


Feedback Screen:

About Us Screen:
Dataset:
Creating Api using Python Flask & implement decision tree algorithm:
Chapter 8: Advantages & Disadvantages:

8.1 Advantages:
 User can diagnose disease from their symptoms
 No waste of time quick service in emergency
 Quick first aid from home
 Easy to carry medical knowledge without even knowing it

8.2 Disadvantages:
 The system is not fully automated; it needs doctors for full diagnosis.

8.3 Future Work


Every one of us would like to have a good medical care system and physicians are expected to be
medical experts and take good decisions all the time. But it’s highly unlikely to memorize all the
knowledge, patient history, records needed for every situation. Although they have all the massive
amount of data and information; it’s difficult to compare and analyse the symptoms of all the
diseases and predict the outcome. So, integrating information into patient’s personalized profile
and performing an in-depth research is beyond the scope a physician. So the solution is ever heard
of a personalized healthcare plan – exclusively crafted for an individual. Predictive analytics is the
process to make predictions about the future by analyzing historical data. For health care, it would
be convenient to make best decisions in case of every individual. Predictive modeling uses
artificial intelligence to create a prediction from past records, trends, individuals, diseases and the
model is deployed so that a new individual can get a prediction instantly. Health and Medicare
units can use these predictive models to accurately assess when a patient can safely be released.
Chapter 9: Conclusion:

9.1 Conclusion:
This system can be used by all patients or their family members who need help in
emergency. Any normal person with little knowledge can handle this app easily can taste the
fruit out of it. It contains vast knowledge about the diseases which can be carried all time by you
anywhere and it will be available anytime to give its services.

You might also like