TapCub is live — analytics, insights and live chat, free on one platform
Glossary

Logistic Regression: Definition and Churn Example

Logistic regression models the probability of a yes/no outcome such as churn or conversion. The formula, a 5,000-account churn example, how to read coefficients as odds ratios, and the checks analysts skip.

Lucas Hayes Reviewed by Chen Yu Also called logit regression Last updated Nov 29, 2026 Glossary

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:

PredictorCoefficientOdds ratio (e^b)95% CI for odds ratio
Intercept−1.155——
Sessions in last 30 days−0.0840.9200.907–0.933
Support tickets in last 30 days+0.3441.4111.291–1.543
Seats on the plan−0.0340.9670.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:

  1. Scale matters. An odds ratio per session and an odds ratio per 10 sessions describe the same effect. State the unit.
  2. 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 regressionLogistic regression
OutcomeContinuous (revenue, time on site)Binary (churned or not, converted or not)
PredictionAny real numberProbability between 0 and 1
LinkIdentityLogit (log-odds)
EstimationLeast squaresMaximum likelihood
Coefficient readingChange in outcome per unitChange in log-odds per unit; e^b is an odds ratio
Fit checkR², residual plotsDiscrimination (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.

ThresholdAccounts flaggedChurners caught (recall)PrecisionAccuracy
0.5000 of 599 (0%)—88.0%
0.20691176 of 599 (29.4%)25.5%81.2%
0.151,480311 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:

  1. 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.
  2. Pull one row per person or account with SQL. The SQL tab runs one SELECT or WITH statement 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).
  3. 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).
  4. 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.
  5. 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

Was this explanation clear?

We use your answers to fix and expand this page.

Lucas Hayes

Data Engineer

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

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What is logistic regression used for?

It predicts the probability of a binary outcome from one or more predictors. Typical analytics uses are churn models, conversion or upgrade propensity, and lead or account scoring. Its coefficients also show which factors are associated with the outcome and in which direction.

How do you interpret a logistic regression coefficient?

Exponentiate it. e raised to the coefficient is the odds ratio for a one-unit increase in that predictor, holding the others fixed. A coefficient of −0.084 gives an odds ratio of 0.920, meaning about 8% lower odds per unit. It is not an 8-point change in probability.

What is the difference between linear and logistic regression?

Linear regression predicts a continuous value and is fitted by least squares. Logistic regression predicts a probability for a binary outcome by modelling log-odds and is fitted by maximum likelihood, so its predictions always stay between 0 and 1.

Why does my logistic regression predict no positive cases?

Usually because the outcome is rare and the threshold is 0.5. If no account has a predicted probability above 50%, nothing is flagged and accuracy equals the share of negatives. Lower the threshold to match the number of cases you can act on, and judge the model by recall, precision, AUC and calibration.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics