Question: **Numpy, pandas, and SKLearn packages allowed** Select the pima diabetes dataset with binary target values from https://machinelearningmastery.com/standard-machine-learning-datasets/ Use pandas to read CSV file as dataframe.

**Numpy, pandas, and SKLearn packages allowed**

  1. Select the pima diabetes dataset with binary target values from

https://machinelearningmastery.com/standard-machine-learning-datasets/

  1. Use pandas to read CSV file as dataframe. (1pt)

e.g. The following code helps import pima diabetes dataset

col_names = ['pregnant', 'glucose', 'bp', 'skin', 'insulin', 'bmi', 'pedigree', 'age', 'label']

# load dataset

pima = pd.read_csv("pima-indians-diabetes-database.csv", header=None, names=col_names)

  1. Select 5 (if not possible then select 4) features from the chosen dataset. (1pt)

List all features you selected in your report.

For example, the following code will select two features

feature_cols = ['pregnant', 'age']

X = pima[feature_cols]

  1. Use train _test_split from sklearn.model_selection to split test and training data by 40% testing + 60% training. (1pt)

  1. Fit your model with training data and test your model after fitting.

  1. Calculate and print out

the confusion matrix (1pt)

precision score, recall score, F score (3pts)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!