The Analytic Edge Lecture code in Python Week3 Framingham Heart Study

Video 3

Read in the dataset

Look at structure

Randomly split the data into training and testing sets

Imputing the datasets

A simple strategy to impute the dataset, replace nans using the mean of that variable

Logistic Regression Model

I will be using scikit-learn this time

Predictions on the test set

Confusion matrix with threshold of 0.5

Accuracy

Baseline accuracy

Test set AUC

 

Leave a Reply

Your email address will not be published. Required fields are marked *