0% found this document useful (0 votes)
4 views6 pages

Machine Learning for Diabetes Prediction

Uploaded by

Moumita Majumder
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)
4 views6 pages

Machine Learning for Diabetes Prediction

Uploaded by

Moumita Majumder
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

DIABETES PREDICTION USING MACHINE

LEARNING
Anjali Kumaria Moumita Mozumderb Greeshma G Sc
21SCSE1010007 21SCSE1011026 Project Guide
Galgotias University Galgotias University Galgotias University
anjali.21SCSE1010007@[Link] ,
moumita.21scse1010026@[Link],
greeshma.s@[Link]

1. Abstract algorithms like K nearest neighbour, Logistic


Regression, Random forest, Support vector
Diabetes is a chronic disease with the potential machine and Decision tree are used. The
to cause a worldwide health care crisis. accuracy of the model using each of the
According to International Diabetes algorithms is calculated. Then the one with a
Federation 382 million people are living with good accuracy is taken as the model for
diabetes across the whole world. By 2035, this predicting the diabetes.
will be doubled as 592 million. Diabetes is a
disease caused due to the increase level of 2. Keywords
blood glucose. This high blood glucose
produces the symptoms of frequent urination, Machine Learning, Diabetes, Decision tree, K
increased thirst, and increased hunger. nearest neighbour, Logistic Regression,
Diabetes is a one of the leading cause of Support vector Machine, Accuracy.
blindness, kidney failure, amputations, heart
failure and stroke. When we eat, our body 3. Introduction
turns food into sugars, or glucose. At that
point, our pancreas is supposed to release Diabetes is the fast growing disease among the
insulin. Insulin serves as a key to open our people even among the youngsters. In
cells, to allow the glucose to enter and allow understanding diabetes and how it develops,
us to use the glucose for energy. But with we need to understand what happens in the
diabetes, this system does not work. Type 1 body without diabetes. Sugar (glucose) comes
and type 2 diabetes are the most common from the foods that we eat, specifically
forms of the disease, but there are also other carbohydrate foods. Carbohydrate foods
kinds, such as gestational diabetes, which provide our body with its main energy source
occurs during pregnancy, as well as other everybody, even those people with diabetes,
forms. Machine learning is an emerging needs carbohydrate. Carbohydrate foods
scientific field in data science dealing with the include bread, cereal, pasta, rice, fruit, dairy
ways in which machines learn from products and vegetables (especially starchy
experience. The aim of this project is to vegetables). When we eat these foods, the
develop a system which can perform early body breaks them down into glucose. The
prediction of diabetes for a patient with a glucose moves around the body in the
higher accuracy by combining the results of bloodstream. Some of the glucose is taken to
different machine learning techniques. The our brain to help us think clearly and function.
The remainder of the glucose is taken to the Frequent Urination
cells of our body for energy and also to our Increased thirst
liver, where it is stored as energy that is used Tired/Sleepiness
later by the body. In order for the body to use Weight loss
glucose for energy, insulin is required. Insulin Blurred vision
is a hormone that is produced by the beta cells Mood swings
in the pancreas. Insulin works like a key to a Confusion and difficulty
door. Insulin attaches itself to doors on the concentrating
cell, opening the door to allow glucose to frequent infections
move from the blood stream, through the door,
and into the cell. If the pancreas is not able to Causes of Diabetes
produce enough insulin (insulin deficiency) or
Genetic factors are the main cause of diabetes.
if the body cannot use the insulin it produces
It is caused by at least two mutant genes in the
(insulin resistance), glucose builds up in the
chromosome 6, the chromosome that affects
bloodstream (hyperglycaemia) and diabetes
the response of the body to various antigens.
develops. Diabetes Mellitus means high levels
Viral infection may also influence the
of sugar (glucose) in the blood stream and in
occurrence of type 1 and type 2 diabetes.
the urine.
Studies have shown that infection with viruses
such as rubella, Coxsackievirus, mumps,
Types of Diabetes hepatitis B virus, and cytomegalovirus
Type 1 diabetes means that the immune increase the risk of developing diabetes.
system is compromised and the cells fail to
produce insulin in sufficient amounts. There 4. Literature Review
are no eloquent studies that prove the causes
of type 1 diabetes and there are currently no Yasodhaet al.[1] uses the classification on
known methods of prevention. diverse types of datasets that can be
accomplished to decide if a person is diabetic
Type 2 diabetes means that the cells produce or not. The diabetic patient’s data set is
a low quantity of insulin or the body can’t use established by gathering data from hospital
the insulin correctly. This is the most common warehouse which contains two hundred
type of diabetes, thus affecting 90% of persons instances with nine attributes. These instances
diagnosed with diabetes. It is caused by both of this dataset are referring to two groups i.e.
genetic factors and the manner of living. blood tests and urine tests. In this study the
implementation can be done by using WEKA
Gestational diabetes appears in pregnant to classify the data and the data is assessed by
women who suddenly develop high blood means of 10-fold cross validation approach, as
sugar. In two thirds of the cases, it will it performs very well on small datasets, and the
reappear during subsequent pregnancies. outcomes are compared. The naïve Bayes, J48,
There is a great chance that type 1 or type 2 REP Tree and Random Tree are used. It was
diabetes will occur after a pregnancy affected concluded that J48 works best showing an
by gestational diabetes. accuracy of 60.2% among others

Symptoms of Diabetes
Aiswaryaet al. [2] aims to discover solutions
to detect the diabetes by investigating and
examining the patterns originate in the data via 5. Methodology
classification analysis by using Decision Tree
and Naïve Bayes algorithms. The research In this section we shall learn about the
hopes to propose a faster and more efficient
various classifiers used in machine learning
method of identifying the disease that will help
to predict diabetes. We shall also explain our
in well-timed cure of the patients. Using
proposed methodology to improve the
PIMA dataset and cross validation approach
accuracy. Five different methods were used in
the study concluded that J48 algorithm gives
this paper. The different methods used are
an accuracy rate of 74.8% while the naïve
defined below. The output is the accuracy
Bayes gives an accuracy of 79.5% by using
metrics of the machine learning models. Then,
70:30 split.
the model can be used in prediction.
Gupta et al. [3] aims to find and calculate the
Dataset Description
accuracy, sensitivity and specificity
percentage of numerous classification The diabetes data set was originated from
methods and also tried to compare and analyse [Link]
the results of several classification methods in Diabetes dataset containing 2000 cases. The
WEKA, the study compares the performance objective is to predict based on the measures
of same classifiers when implemented on to predict if the patient is diabetic or not.
some other tools which includes Rapidminer
and Matlabusing the same parameters (i.e.
accuracy, sensitivity and specificity). They
applied JRIP, Jgraft and BayesNet algorithms.
The result shows that Jgraft shows highest
accuracy i.e 81.3%, sensitivity is 59.7% and
specificity is 81.4%. It was also concluded that
WEKA works best than Matlab and
Rapidminner.

Lee et al. [4] focus on applying a decision tree


algorithm named as CART on the diabetes
dataset after applying the resample filter over
the data. The author emphasis on the class
imbalance problem and the need to handle this
problem before applying any algorithm to
achieve better accuracy rates. The class Fig:1 Diabetes preview
imbalance is a mostly occur in a dataset having
dichotomous values, which means that the • The diabetes data set consists of 2000
class variable have two possible outcomes and data points, with 9 features each.
can be handled easily if observed earlier in • “Outcome” is the feature we are going to
data preprocessing stage and will help in predict, 0 means No diabetes, 1 means
boosting the accuracy of the predictive model. diabetes.
• There is no null values in dataset.

Fig:4 Heatmap of feature correlation


Observations:
• The countplot tells us that the dataset is
Fig:2 stastical summary imbalanced, as the number of patients who
don’t have diabetes is more than those who
do.
• From the correlation heatmap, we can see
that there is a high correlation between
Outcome and [Glucose, BMI, Age,
Insulin]. We can select these features to
accept input from the user and predict the
outcome.
It is easy to see that there is no single feature
that has a very high correlation with our
Fig:3 outcome value. Some of the features have a
Observations: negative correlation with the outcome value
• There are a total of 768 records and 9 and some have positive.
features in the dataset.
• Each feature can be either of integer or Histogram:
float data type.
• Some features like Glucose, Blood
pressure, Insulin, BMI have zero values
which represent missing data.
• There are zero NaN values in the dataset.
• In the outcome column, 1 represents
diabetes positive and 0 represents diabetes
negative.
Let’s take a look at the plots. It shows how
each feature and label is distributed along
different ranges, which further confirms the
need for scaling. Next, wherever you see
discrete bars, it basically means that each of
these is actually a categorical variable. We will
need to handle these categorical variables
before applying Machine Learning. Our
outcome labels have two classes, 0 for no
disease and 1 for disease.

Algorithm:
Support Vector Classifier(SVC) :
It is a type of supervised classification model
whose objective is to classify the data based
on a maximal margin hyperplane build using
support vectors. This hyperplane is a decision
boundary that classifies between various
classes. It is build using support vectors, which
are the outliers. The hyperplane which has the
highest margin is selected as the decision
boundary.

SVCs can classify linear as well as non-linear


data using a kernel trick which implicitly maps
the input to high dimensional vector spaces.
This kernel trick converts the lower-
dimensional feature space into higher
dimensional feature space which is linearly
separable. For example, data in a 2D may not
be linearly separable but when it is converted
into 3D using the kernel function it becomes
linearly separable.

SVC has three main parameters that affect the


performance of the model which are the
kernel, gamma, C. The kernel parameter
signifies the type of kernel which can be
“Linear” for linearly separable data or “rbf”,
“poly” for non linearly separable data. Gamma
parameter is the kernel coefficient. As the
value of gamma increases, it tries to exactly fit
the dataset which gives generalization error
and causes overfitting. C parameter is the cost
of misclassification of the model. The high
value of C gives you low bias and high
variance whereas the low value of C gives you
high bias and low variance.

You might also like