1. Learn
  2. /
  3. Courses
  4. /
  5. Linear Classifiers in Python

Exercise

Visualizing multi-class logistic regression

In this exercise we'll continue with the two types of multi-class logistic regression, but on a toy 2D data set specifically designed to break the one-vs-rest scheme.

The data set is loaded into X_train and y_train. The two logistic regression objects,lr_mn and lr_ovr, are already instantiated (with C=100), fit, and plotted.

Notice that lr_ovr never predicts the dark blue class… yikes! Let's explore why this happens by plotting one of the binary classifiers that it's using behind the scenes.

Instructions

100 XP
  • Create a new logistic regression object (also with C=100) to be used for binary classification.
  • Visualize this binary classifier with plot_classifier… does it look reasonable?