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.
Related terms
Gradient descent is an optimization algorithm that finds the minimum of a function by repeatedly moving in the direction of the steepest downward slope. In machine learning it is used to minimize a model's error by adjusting parameters step by step.
Adam (Adaptive Moment Estimation) is a popular optimization algorithm used to train machine learning models by iteratively updating parameters based on gradients.
Classification is a supervised machine learning task that assigns input data to one of several predefined categories or classes based on patterns learned from labeled training examples.
Clustering is an unsupervised machine learning technique that automatically groups similar data points together into clusters based on their features, without using any labeled examples.
A hyperparameter is a value or setting chosen by the user before training a machine learning model that controls the learning process itself.
The learning rate is a hyperparameter that controls the size of the steps an optimization algorithm takes when updating a model's parameters during training.