1. Learn
  2. /
  3. Courses
  4. /
  5. Dimensionality Reduction in Python

Exercise

Building a diabetes classifier

You'll be using the Pima Indians diabetes dataset to predict whether a person has diabetes using logistic regression. There are 8 features and one target in this dataset. The data has been split into a training and test set and pre-loaded for you as X_train, y_train, X_test, and y_test.

A StandardScaler() instance has been predefined as scaler and a LogisticRegression() one as lr.

Instructions

100 XP
  • Fit the scaler on the training features and transform these features in one go.
  • Fit the logistic regression model on the scaled training data.
  • Scale the test features.
  • Predict diabetes presence on the scaled test set.