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.
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
Learn it in a course
Read about it on the blog
Sources and further reading
Other terms from ML Models & Algorithms
- BERT (Bidirectional Encoder Representations from Transformers)Google's 2018 transformer language model that reads text in both directions to produce context-aware embedding…
- BERTopicA modular topic modelling technique that clusters transformer embeddings and labels each cluster with class-ba…
- BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies)BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies) clusters very large numeric datasets by s…
- BM25A classic ranking function that scores documents by how often query words appear, adjusted for word rarity and…
- Boyer-MooreA fast exact string-search algorithm that compares a pattern from right to left and skips ahead after mismatch…
- c-TF-IDFClass-based TF-IDF: treats each cluster as one document to find the words that best describe it, used by BERTo…
- Centroid-based ClusteringA clustering family that groups data around central points (centroids), each the average of its cluster's memb…
- Convolutional Neural Network (CNN)A deep learning architecture that scans data with small learned filters to detect local patterns; the classic…
- DBSCANDensity-based clustering that groups closely packed points, finds the number of clusters itself and labels iso…

