Question 7 - Jupyter Notebook
Question 7 - Jupyter Notebook
Create a full ML model for Sklearn’s Diabetes dataset. Load the dataset from sklearn itself. a.
Perform the first 5 data science life cycle steps for this model. b. Write down information
surmised from each code snippet in the markdown cell below each code cell.
In [3]:
Out[3]:
Pregnancies Glucose BloodPressure SkinThickness Insulin BMI DiabetesPedigreeFunction
1 1 85 66 29 0 26.6 0.351
3 1 89 66 23 94 28.1 0.167
1 of 4 10/23/2023, 1:21 AM
question 7 - Jupyter Notebook http://localhost:8888/notebooks/OneDrive/Desktop/Folders/MU/Sem-7...
In [4]:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 768 entries, 0 to 767
Data columns (total 9 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Pregnancies 768 non-null int64
1 Glucose 768 non-null int64
2 BloodPressure 768 non-null int64
3 SkinThickness 768 non-null int64
4 Insulin 768 non-null int64
5 BMI 768 non-null float64
6 DiabetesPedigreeFunction 768 non-null float64
7 Age 768 non-null int64
8 Outcome 768 non-null int64
dtypes: float64(2), int64(7)
memory usage: 54.1 KB
In [5]:
In [6]: # Split the data into features (X) and target (y)
X = df.drop(columns='Outcome')
y = df['Outcome']
2 of 4 10/23/2023, 1:21 AM
question 7 - Jupyter Notebook http://localhost:8888/notebooks/OneDrive/Desktop/Folders/MU/Sem-7...
In [10]:
0.7532467532467533
In [12]:
In [14]:
[[79 20]
[18 37]]
3 of 4 10/23/2023, 1:21 AM
question 7 - Jupyter Notebook http://localhost:8888/notebooks/OneDrive/Desktop/Folders/MU/Sem-7...
In [ ]:
4 of 4 10/23/2023, 1:21 AM