Session Ready
Exercise

Logistic regression for images

In this exercise, you will build a logistic regression model on a breast cancer dataset from the last exercise and evaluate its accuracy.

The X_train, X_test, y_train, and y_test that you created in the last exercise are available in your workspace, along with sklearn and pandas as pd. LogisticRegression is available via sklearn.linear_model.

Instructions
100 XP
  • Create a logistic regression classifier.
  • Fit the classifier using training data to make predictions for the testing data.
  • Assign totals for correct and incorrect predictions between training and testing targets to num_right and num_wrong respectively.
  • Compute accuracy using num_right and num_wrong using sum().