Search⌘ K

Logistic Regression

Explore how to implement logistic regression for classification tasks using scikit-learn. Learn to handle both binary and multiclass classification, choose solvers, adjust iterations for convergence, and apply cross-validation with LogisticRegressionCV. This lesson equips you with practical skills for modeling linearly separable datasets effectively.

Chapter Goals:

  • Learn about logistic regression for linearly separable datasets

A. Classification

Thus far we've learned about several linear regression models and implemented them with scikit-learn. The logistic regression model, despite its name, is actually a linear model for classification. It is called logistic regression because it performs regression on logits, which then allows us to classify the data based on model probability predictions.

For a more detailed explanation of logistic regression, check out the Intro to Deep Learning section of this course, which implements logistic regression via a single layer perceptron model in TensorFlow.

We implement logistic regression with the LogisticRegression ...