Quick answer
Logistic regression is a statistical model for a yes/no outcome, such as churn or conversion. It models the log-odds of the outcome as a linear combination of predictors, so it outputs a probability between 0 and 1, and each exponentiated coefficient is an odds ratio.
Formula: P(y=1) = 1 / (1 + e^-(b0 + b1x1 + ... + bkxk)); odds ratio for xi = e^bi
What is logistic regression?
Logistic regression is a statistical model for a yes/no outcome. It estimates the probability that something happens, such as a visitor converting or a customer churning, from one or more predictors, by modelling the log-odds of the outcome as a linear combination of those predictors.
It is the default first model for binary questions in product and marketing analytics because its output is a probability and its coefficients have a direct reading: each one, exponentiated, is an odds ratio. That interpretability is also where most mistakes happen. Analysts read odds ratios as probability changes, judge the model by accuracy on imbalanced data, and skip the checks for separation and calibration. This page covers the model and those checks with one worked churn example.
The logistic regression formula
For predictors x₁ … xₖ, the model is:
P(y = 1) = 1 ÷ (1 + e^−(b₀ + b₁x₁ + … + bₖxₖ))
Equivalently, on the log-odds (logit) scale:
log(p ÷ (1 − p)) = b₀ + b₁x₁ + … + bₖxₖ
- p ÷ (1 − p) is the odds. A probability of 0.8 is odds of 4 to 1.
- The right-hand side is linear, like linear regression, but it predicts log-odds, so the predicted probability always stays between 0 and 1.
- The coefficients are estimated by maximum likelihood, not by least squares.
- e^bᵢ is the odds ratio for a one-unit increase in xᵢ, holding the other predictors fixed. UCLA's statistical consulting group shows the same identity with a worked crosstab: the exponentiated coefficient equals the ratio of the two groups' odds, as long as the model has no interaction terms (UCLA OARC).
Worked example: a churn model on 5,000 accounts
Sample data: a subscription product has 5,000 accounts; 599 (12.0%) churned last quarter. A logistic regression on three predictors gives:
| Predictor | Coefficient | Odds ratio (e^b) | 95% CI for odds ratio |
|---|---|---|---|
| Intercept | −1.155 | — | — |
| Sessions in last 30 days | −0.084 | 0.920 | 0.907–0.933 |
| Support tickets in last 30 days | +0.344 | 1.411 | 1.291–1.543 |
| Seats on the plan | −0.034 | 0.967 | 0.952–0.981 |
Predicting one account by hand: 5 sessions, 2 tickets, 3 seats.
- Log-odds = −1.155 − 0.084 × 5 + 0.344 × 2 − 0.034 × 3 = −0.989
- Probability = 1 ÷ (1 + e^0.989) = 27.1%
An active account with 30 sessions, no tickets and 10 seats: log-odds = −1.155 − 2.52 − 0.34 = −4.015, probability 1.8%.
Reading coefficients as odds ratios
The session coefficient of −0.084 means each extra session multiplies the odds of churn by e^−0.084 = 0.920, about 8% lower odds. Ten extra sessions multiply the odds by e^−0.84 = 0.432, not by 10 × 0.920.
Odds ratios are not probability changes. In the example, going from 5 to 6 sessions changes the odds from 0.372 to 0.342 (ratio 0.920) and the probability from 27.1% to 25.5%, a drop of 1.6 points. For an account starting at a 1.8% probability, the same odds ratio moves the probability by about 0.14 points. Report odds ratios for the direction and strength of an effect, and predicted probabilities for anything a business reader will act on.
Two more reading rules:
- Scale matters. An odds ratio per session and an odds ratio per 10 sessions describe the same effect. State the unit.
- Association, not cause. Accounts with more sessions churn less, but forcing sessions up will not necessarily reduce churn. Logistic regression is a description of the data unless the predictor was assigned in an experiment.
Logistic vs linear regression
| Linear regression | Logistic regression | |
|---|---|---|
| Outcome | Continuous (revenue, time on site) | Binary (churned or not, converted or not) |
| Prediction | Any real number | Probability between 0 and 1 |
| Link | Identity | Logit (log-odds) |
| Estimation | Least squares | Maximum likelihood |
| Coefficient reading | Change in outcome per unit | Change in log-odds per unit; e^b is an odds ratio |
| Fit check | R², residual plots | Discrimination (AUC), calibration, deviance |
Using linear regression on a 0/1 outcome (a "linear probability model") can predict values below 0 or above 1 and misstates uncertainty. For continuous outcomes and multiple regression in general, see regression analysis.
The checks analysts skip
1. Class imbalance and the 0.5 threshold. In the sample, the highest predicted churn probability for any account is 47%. At the usual 0.5 cut-off the model flags nobody, and accuracy is 4,401 ÷ 5,000 = 88.0%, exactly what you get by predicting "no churn" for everyone.
| Threshold | Accounts flagged | Churners caught (recall) | Precision | Accuracy |
|---|---|---|---|---|
| 0.50 | 0 | 0 of 599 (0%) | — | 88.0% |
| 0.20 | 691 | 176 of 599 (29.4%) | 25.5% | 81.2% |
| 0.15 | 1,480 | 311 of 599 (51.9%) | 21.0% | 70.9% |
Accuracy falls as the model becomes useful. Choose the threshold from what you can act on: if the success team can contact about 700 accounts a quarter, 0.20 is the operating point, and each contact has about a one-in-four chance of being a real churn risk.
2. Discrimination. The area under the ROC curve (AUC) is 0.69: a randomly chosen churner gets a higher score than a randomly chosen non-churner 69% of the time. Useful for prioritising, far from a crystal ball.
3. Calibration. Sort accounts into ten equal groups by predicted probability. The top group averages a predicted 27.0% and 140 of its 503 accounts churned (27.8%); the bottom group predicts 2.0% and 8 of 499 churned (1.6%). Predicted and observed agree, so the probabilities can be used as probabilities, for example to estimate expected churned revenue.
4. Separation. If a predictor perfectly splits the outcome (every account with "cancellation page viewed" churned), maximum likelihood has no finite solution and the coefficient runs toward infinity. Symptoms are huge coefficients and standard errors. Remove leaked predictors that are really part of the outcome, or use a penalised method.
5. Library defaults. Some libraries regularise by default. scikit-learn's LogisticRegression notes that regularization is applied by default, with C=1.0 (an L2 penalty) and class_weight=None in version 1.9.1 (scikit-learn). Penalised coefficients are shrunk toward zero, so their odds ratios are not the plain maximum-likelihood estimates a statistics package reports. Know which one you are reading before you quote an odds ratio.
Logistic regression for churn and conversion
The most common analytics uses are churn models, conversion propensity (will this trial convert?), and lead or account scoring. In each case the model turns behaviour into a ranked list. A churn risk score from logistic regression is one form of predictive analytics; its value depends on whether someone acts on the top of the list and whether you measure what happened next.
Good predictors are behavioural and measured before the outcome window: sessions, active days, key-feature use, support contacts, seats. Predictors measured during or after the outcome (such as "visited the cancellation page") leak the answer and produce separation.
Getting model features out of TapCub
TapCub does not fit statistical models and has no built-in churn prediction. It is where the behavioural predictors for a model like the one above come from:
- Define the predictors as metrics. Sessions in the last 30 days, active days and key events per person can be built in All-platform analytics › Behavior › Metrics & SQL, using event counts, distinct counts or averages.
- Pull one row per person or account with SQL. The SQL tab runs one
SELECTorWITHstatement against the project's events, sessions and persons views. A grouped query gives one row per user with the feature columns, exportable as CSV (up to 50,000 rows per result). - For larger raw extracts, use an export job. All-platform analytics › Data › Data export creates asynchronous exports of events, sessions or persons (JSONL; not on the free tier).
- Add the outcome from your billing or CRM system (churned yes/no for the quarter), fit the model in your statistics tool, and run the checks above.
- Act and measure. Put the high-risk accounts into a static segment in All-platform analytics › Users › Segments & tags by pasting their IDs, then follow their retention in behaviour analysis to see whether the outreach changed anything.
Sources
- UCLA Office of Advanced Research Computing, How do I interpret odds ratios in logistic regression?, checked 2026-11-29.
- scikit-learn, sklearn.linear_model.LogisticRegression, documentation version 1.9.1, checked 2026-11-29.
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Data Engineer
Writes about event design, data quality, and collection workflows, with verifiable implementation methods for reliable analytics.