Simple Data Science (diabetes diagnosis solution)

--

We have obtained personal data and we are trying to tell whether a patient has diabetes or not, from that data.

The data we are going to use is a simple dataset from https://www.kaggle.com/datasets/sujithmandala/easiest-diabetes-classification-dataset.

This dataset contains a spreadsheet table that displays personal health information of each patient. The data includes things such as:

Gender: The patient’s gender, male or female.

BMI: The patient’s body mass index (BMI), a measure of weight relative to height.

Blood pressure: The patient’s blood pressure, in mmHg.

FBS: The patient’s fasting blood sugar, in mg/dL.

Blood pressure: The patient’s blood pressure, in mmHg.

FBS: The patient’s fasting blood sugar, in mg/dL.

HbA1c: The patient’s hemoglobin A1c, a measure of blood sugar control over the past 3 months.

Family history of diabetes: Whether the patient has a family history of diabetes.

Smoking: Whether the patient smokes.

Diet: Whether the patient has a poor or healthy diet.

Exercise: Whether the patient exercises regularly.

From the data of each patient, we try to diagnose him as diabetic or not.

In this article, we are going to tackle this problem in a simple way and without using any artificial intelligence known methods.

STEP 1:

We have to try to UNDERSTAND what ‘diabetes’ is and how it is diagnosed. We have to also understand what each term in the dataset means; such as ‘age’, ‘gender’, ‘BMI’, ‘FSB’, ‘Diet’ and how each plays a role in diagnosing this disease.

STEP 2:

Assuming from STEP 1 above, we obtain that :

a) if a person has a family history of diabetes and he also has a poor diet and his FSB is greater than 125mg/dl then it indicates he likely has diabetes.

b) if a person has a history of smoking and he has a poor diet and his FSB is greater than 125mg/dl then it indicates he likely has diabetes.

c) else he likely does not have diabetes yet.

Then we can convert this information to a simple YES/NO question-answer dialog. This means that the problem of diagnosing a person of diabetes can be solved using normal ‘if-else’ programming.

The code below is a java method that does just that and it is self explanatory.

java method to diagnose diabetes

What I did not include in this article is how to obtain the data of patients, how to load the data into the program, and how to use the java code above in a complete program

--

--

Brunner1000 (hedtellarticless@gmail.com)

Name: Arthur Brunner. I majored in computer science. Currently working on https://rev25.com which is a complete computer vision software for robotic companies