Skip to content

What is Logistic Regression?

Logistic Regression is a supervised machine learning algorithm used for binary classification that estimates the probability an input belongs to a particular class.

It works by combining input features with learned weights, then passing the result through a sigmoid function that squashes the output into a probability between 0 and 1.

During training, the model adjusts its weights to minimize a loss function (typically log loss) using optimization techniques such as gradient descent.

Although called 'regression,' it produces class probabilities that are turned into discrete predictions via a threshold, usually 0.5.

Example

A doctor uses logistic regression on patient data like age, blood pressure, and cholesterol levels to predict the probability that a person will develop heart disease within five years.

Why it matters

It remains a fast, interpretable baseline for classification tasks and serves as a building block inside many neural networks and generalized linear models used across industry and research.

Frequently asked questions

The basic form handles binary outcomes, but extensions like multinomial logistic regression or one-vs-rest strategies allow it to handle multiple classes.