You are on page 1of 4

Name : MANOGNA GV email id:

manognagv12@gmail.com
MAJOR PROJECT: DIABETES PREDICTION
Let's import required libraries!
In [6]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import pandas_profiling as pp
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split,GridSearchCV
from sklearn.metrics import accuracy_score,confusion_matrix

import warnings
warnings.filterwarnings('ignore')

sns.set()
%matplotlib inline

Let's read the data!


In [10]:
df=pd.read_csv(r"C:\Users\Manogna G V\Downloads\diabetes.csv")

In [11]:
df.head()

Out[11]:
Pregnanci Glucos BloodPress SkinThickne Insuli BM DiabetesPedigreeFunc Ag Outco
es e ure ss n I tion e me
0 33.
6 148 72 35 0 0.627 50 1
6
1 26.
1 85 66 29 0 0.351 31 0
6
2 23.
8 183 64 0 0 0.672 32 1
3
Pregnanci Glucos BloodPress SkinThickne Insuli BM DiabetesPedigreeFunc Ag Outco
es e ure ss n I tion e me
3 28.
1 89 66 23 94 0.167 21 0
1
4 43.
0 137 40 35 168 2.288 33 1
1
In [12]:
df.shape

Out[12]:
(768, 9)
In [13]:
df.dtypes

Out[13]:
Pregnancies int64
Glucose int64
BloodPressure int64
SkinThickness int64
Insulin int64
BMI float64
DiabetesPedigreeFunction float64
Age int64
Outcome int64
dtype: object

Let's check it out whether there are any null values


In [14]:
df.isnull().sum()

Out[14]:
Pregnancies 0
Glucose 0
BloodPressure 0
SkinThickness 0
Insulin 0
BMI 0
DiabetesPedigreeFunction 0
Age 0
Outcome 0
dtype: int64

Wohh Great!! There are no null values.

Let's go for Auto-EDA


In [15]:
pp.ProfileReport(df)

Out[15]:
Summarize dataset: 100%
22/22 [00:15<00:00, 1.30s/it, Completed]
Generate report structure: 100%
1/1 [00:05<00:00, 5.39s/it]
Render HTML: 100%
1/1 [00:04<00:00, 4.68s/it]

“The profile report will display once we run the code


file.”(since unable to paste it here)

Pandas Profiling has given some meaningfull insights

In [16]:
sns.heatmap(df.corr(),cbar=False,cmap='BuGn',annot=True)

Out[16]:
<matplotlib.axes._subplots.AxesSubplot at 0x1b3fea1dc70>
In [ ]:

You might also like