doyouhavediabetes
doyouhavediabetes
Oh my god! Do you have Diabetes!?
9 posts
Don't wanna be here? Send us removal request.
doyouhavediabetes · 4 years ago
Text
Thank you for patiently reading. Feel free to give any suggestions or comments.
BYE!
Tumblr media
0 notes
doyouhavediabetes · 4 years ago
Link
You can refer to the COLAB notebook by clicking here:)
0 notes
doyouhavediabetes · 4 years ago
Text
Decision Tree Classifier #6
FINALLLLLLYYYY!
We can now visualise the data as a decision tree. It uses Image, StringIO and export_graphviz classes.
Tumblr media
here is the OUTPUT,
Tumblr media
I know this output is not very standard or optimised, but we will deal with the tuned Decision Tree some other time.
0 notes
doyouhavediabetes · 4 years ago
Text
Decision Tree Classifier #5
The time has finally come when we need to use the DecisionTreeClassifier class and predict the accuracy of the same.��
Tumblr media
We can see that the accuracy score of the dataset while applying Decision Tree Classifier is approximately 66%. This model is not very apt in determining whether a person is suffering from diabetes.
Now we draw a confusion matrix as in to determine the number of people suffering from diabetes and number of people not suffering from diabetes.
Tumblr media
We can see 111 suffer from diabetes and 49 doesn’t.
0 notes
doyouhavediabetes · 4 years ago
Text
Decision Tree Classifier #4
Since, we have read the dataset, we should perform some functions to reduce the null values and anomalies of the data. 
We use dropna() function.
Tumblr media
After the dataset is cleaned, we can now divide the dataset into prediction attributes (X) and a target attribute (y)
Tumblr media
Now , we apply the train_test_split to divide the dataset into train data and test data. We consider test_size as 0.3, which means 70% train data and 30% test data. 
After getting the values for all the four variables, we shape them.
Tumblr media
0 notes
doyouhavediabetes · 4 years ago
Photo
Tumblr media
Total length of the diabetes dataset
0 notes
doyouhavediabetes · 4 years ago
Text
Decision Tree Classifier #3
Let us start with the implementation NOW!
NOTE: You will require any Python IDE like anaconda navigator or can even use Google Colab. I personally use COLAB and I feel it is much better and handy than any other IDE because you get everything in one place.
First, we do very basic but very important stuff i.e. IMPORT ALL THE REQUIRED CLASSES
Tumblr media
Then, we mount the .csv file in google drive and specify the path of the file to be worked on.
Tumblr media
Look on the dataset displayed (only first 5 rows in this case),
Tumblr media
0 notes
doyouhavediabetes · 4 years ago
Text
Decision Tree Classifier #2
Now that we know what a decision tree is, let’s jump straight into the problem and look upon the dataset that we will use for prediction. That’s right, PREDICTION
We will be using a dataset which will help us to predict whether a person has diabetes or not. WELL, NOW YOU MUST KNOW, WHY #doyouhavediabetes :P
You can find the dataset that I am using on Kaggle.com. I will keep the link below.
 https://www.kaggle.com/johndasilva/diabetes
0 notes
doyouhavediabetes · 4 years ago
Text
Decision Tree Classifier #1
A decision tree classifier is a classification model in Machine Learning that predicts the output of a given problem in the form of a tree. 
A decision tree includes a root node, also called the origin of the tree, the internal nodes which branches out further into leaf nodes. Once an attribute of a dataset reaches the leaf node, it can now help you in predicting the correct output.
The main purpose of the decision tree classifier is to find the most appropriate prediction attributes one by one from the dataset and accordingly classify/branch the nodes of the tree. This process happen until all the prediction attributes are dealt with and the target attribute is achieved.
Well, did you know!? A decision tree is actually inspired by a real tree!
Tumblr media
0 notes