Skip to content

ML Models & Algorithms

Logistic Regression

In shortA simple, interpretable classification model that turns a weighted sum of features into a probability between 0 and 1.

Updated 24 Oct 2026· 2 min read

Logistic regression is a supervised machine learning model for classification. Despite the name, it predicts categories: it estimates the probability that an example belongs to a class, such as “will churn” or “will not churn”, and classifies it by comparing that probability with a threshold. It is one of the oldest and most widely used classification models because it is fast, needs little data and is easy to explain.

How it works

  • Each input feature (for example, number of sessions, days since last purchase, email opens) gets a weight.
  • The model adds up the weighted features to get a score.
  • The logistic (sigmoid) function squeezes that score into a value between 0 and 1, drawing the S-shaped curve MLforSEO uses to illustrate it.
  • If the probability is above a threshold (often 0.5), the example is labelled positive.

Training finds the weights that make the predicted probabilities match the labelled examples as closely as possible. Each weight tells you how a feature pushes the prediction up or down, which is why it is popular when you need to explain a model to stakeholders.

The basic model is for binary classification. For three or more classes you either train one model per class (one-vs-rest) or use the multinomial version with a softmax function; libraries such as scikit-learn handle this automatically.

How it’s used in SEO and marketing

  • Predicting customer churn, email opens or ad engagement.
  • Lead scoring: estimating how likely a lead is to convert.
  • Classifying search intent or page type from text features such as TF-IDF vectors.
  • Sentiment classification, where MLforSEO’s sentiment deep dive cites research finding TF-IDF combined with logistic regression the most efficient approach among the studies reviewed for tweets.
  • A quick baseline to beat before trying complex models.

Example

You want to predict which blog posts will earn at least one backlink in their first 90 days. Features might include word count, number of original images, whether the post includes data, and topic. A logistic regression model trained on your past posts returns a probability for each new draft, and its weights show which features mattered most.

Limitations and things to watch

  • It draws straight-line (linear) boundaries, so it misses complex interactions unless you engineer features.
  • Highly correlated features make the weights unstable and harder to interpret.
  • On imbalanced data, tune the threshold and use class weights; accuracy alone misleads.
  • Probabilities are only well calibrated if the model fits the data well.

Learn it on MLforSEO

Where Logistic Regression shows up on MLforSEO

Sources and further reading

Other terms from ML Models & Algorithms

See all 55 ML Models & Algorithms terms →