Frequentist Estimation, Bayesian Interpretation in Logistic

A maximum-likelihood fit, a probability for one patient and a 0.5 cutoff: which parts are frequentist, which are Bayesian, and what you must check before trusting the number.

Binary Buddies · 5 min read · 4 views

You fit a logistic regression for heart disease. For one patient it returns 0.90, you apply a 0.5 threshold, and the patient is labelled positive. A question on Cross Validated, Frequentist estimation but Bayesian interpretation, asks whether that pipeline quietly smuggles in a Bayesian reading of probability: the coefficients came from a frequentist procedure, yet we talk about the 90% as a probability for this one person.

The worry has a real basis. A strict frequentist probability is a long-run frequency over repeated trials, and a single patient is not a repeated trial. Yet every predict_proba call in machine-learning code reads as a statement about an individual. Two things get tangled: how the parameters were estimated, and what the output number is taken to mean.

The answers to the question separate them, and the separation is useful beyond the philosophy. It tells you what you can claim about a 0.90, what you have to check before claiming it, and which parts of the pipeline would change if you moved to a Bayesian fit.

What the model actually outputs

For two classes, the logistic model gives a conditional probability of the class given the predictors:

P(G = 1 | X = x) = exp(b0 + b'x) / (1 + exp(b0 + b'x))
P(G = 0 | X = x) = 1 / (1 + exp(b0 + b'x))

As one answer puts it, these are conditional probabilities: conditional on the values of the predictors. You can read them as 'given these predictor values, the probability that this example is in class 1 is P'. Nothing in that sentence requires you to pick a philosophy of probability. The two probabilities sum to one and stay inside [0, 1] by construction, which is the property the logistic form was chosen to guarantee.

Why the word 'posterior' keeps appearing

The same answer points to Hastie, Tibshirani and Friedman (2009), Chapter 4, with a short introduction in Chapter 2 on pages 21-22. There the goal is stated as modelling the posterior probabilities of the K classes via linear functions in x. That wording is where much of the confusion comes from.

'Posterior' here is partly a matter of framing. The probabilities are conditional on the data, so they are posterior to the data in a loose sense. But the fit is done by maximum likelihood, which the answer describes as an estimation procedure that is basically frequentist, though really Fisherian. Logistic regression is also a discriminative model, not a generative one. It models the class given the features directly and assumes no prior over classes. If you want a Bayesian derivation that starts from a prior and a class-conditional model, the answer notes that you end up at linear discriminant analysis, which is generative and makes many more assumptions about the joint distribution of X.

What a genuinely Bayesian model would add

The answer is explicit that a maximum-likelihood logistic regression does not give you true posterior probabilities. In a Bayesian framework you would have a posterior predictive distribution, and it would carry uncertainty about the parameter values into the predicted probability. The frequentist fit plugs in a single point estimate of the coefficients and reports the result.

For the practitioner this is a concrete difference, not a labelling dispute. Two patients can both get 0.90 from the plug-in model while one sits in a densely sampled region of feature space and the other far out in a sparse one. The point estimate does not distinguish them. A posterior predictive would, because the uncertainty about the coefficients matters more where the data is thin.

The decision rule is not a Bayesian commitment

The step that looks most Bayesian is the classification: probability above 0.5, so label 1. The answer addresses this directly. Classifying to the most probable class under 0-1 loss is a Bayes decision rule, but using it does not imply or require a Bayesian interpretation of probabilities. It is a decision rule that minimises the Bayes risk, and the name is a coincidence of vocabulary as far as your interpretation goes.

A second answer goes further: there is nothing Bayesian about making a diagnosis. Acting on the most likely diagnosis does not mean ruling out the alternatives. It means you stop investigating for now and proceed on that basis, perhaps with an intervention whose result feeds back into revising the diagnosis. The threshold is a policy, and the 0.5 in the original question is not special; the asker notes the specific threshold is not relevant.

Is the 90% about this patient or patients like them?

This is the core of the original question. The asker's frequentist reading is that, of all patients with the same or very similar characteristics, about 90% would be expected to have heart disease. The second answer agrees that this is how we would interpret the probability: as the probability for a patient with characteristics like the present patient. It adds that it does not see this as inherently Bayesian or frequentist.

That is the practical reading. The model never sees anything about the individual beyond the columns you gave it, so the 0.90 is a statement about everyone who looks like this in feature space. The individual-level language is shorthand for that. If you find yourself wanting to say something about this patient that goes beyond those features, you have left what the model can tell you.

Calibration is the frequentist check

If you want to treat 0.90 as a frequentist probability, the claim is testable. The same answer calls calibration a frequentist operating characteristic: across enough patients for whom the model says 90%, about 90 out of every 100 should actually have the diagnosis. Before reading the output as a probability in that sense, the answer advises caution and making sure the model is well calibrated.

This changes what you ship. A model with a good ranking metric can still produce numbers that are not probabilities in any frequency sense. If downstream code or a clinician reads 0.90 as 'nine in ten', you owe them evidence that the number behaves that way on held-out data. If you only need ordering, you can skip the claim.

Using the output purely as a ranking

The first answer offers a way to avoid the interpretive question entirely. If you stick with the raw values in [0, 1], they are a way to rank examples. Patient A at 0.80 has a higher risk than patient B at 0.70, and that statement needs no view on what probability means.

This is a legitimate design choice for triage queues, review prioritisation or any setting where capacity, not a fixed threshold, decides who gets attention. It is weaker than a calibrated probability, since it says nothing about how much higher the risk is, and it cannot support an expected-cost calculation. Pick it deliberately, and do not drift into it by never checking calibration.

When the probability does become Bayesian, and where this stops fitting

The second answer names the point at which the reading changes. The probability becomes clearly a Bayesian personal probability if you insert prior beliefs into the analysis, either because you hold priors about how much some risk factors matter, or because you have personal beliefs about this specific patient beyond what their model features capture. A clinician who adjusts a 0.90 up or down from information outside the model is doing exactly this, informally.

Know also where the plain frequentist pipeline is the weaker tool. If outcomes are continuous and you want a decision based on utility, the answer notes that a Bayesian analysis with MCMC sampling makes this easier: compute the utility for each sample and summarise that distribution. For a simple two-way diagnosis it says the Bayesian route is not inherently easier. And remember the limits of the plug-in fit: it ignores parameter uncertainty, it does not by itself guarantee calibration, and neither the model nor the threshold can tell you anything about the individual that is not in the features.

This article draws on Frequentist estimation but Bayesian interpretation and answers to it (1, 2), on the Stack Exchange network, licensed under CC BY-SA 4.0.

  • #Machine Learning
  • #bayesian
  • #frequentist
  • #logistic
  • #logistic regression
  • #probability

Comments

Add a comment
Sign in with Google to join the conversation