13
$\begingroup$

Suppose we replace the loss function of the logistic regression (which is normally log-likelihood) with the MSE. That is, still have log odds ratio be a linear function of the parameters, but minimize the sum of squared differences between the estimated probability and the outcome (coded as 0 / 1):

$\log \frac p{1-p} = \beta_0 + \beta_1x_1 + ... +\beta_nx_n$

and minimize $\sum(y_i - p_i)^2$ instead of $\sum [y_i \log p_i + (1-y_i) \log (1-p_i)]$.

Of course, I understand why log likelihood makes sense under some assumptions. But in machine learning, where assumptions are usually not made, what is the intuitive reason the MSE is completely unreasonable? (Or are there situations where MSE might make sense?).

$\endgroup$
1
  • 1
    $\begingroup$ You can use MSE as your optimisation criterion but in that case you shouldn't optimise it with maximum likelihood but with a variant of gradient descent. This is basically what the linear perceptron does. $\endgroup$
    – Digio
    Commented Jun 26, 2017 at 12:29

2 Answers 2

16
$\begingroup$

The short answer is that likelihood theory exists to guide us towards optimum solutions, and maximizing something other than the likelihood, penalized likelihood, or Bayesian posterior density results in suboptimal estimators. Secondly, minimizing sum of squared errors leads to unbiased estimates of true probabilities. Here you do not desire unbiased estimates, because to have that estimates can be negative or greater than one. To properly constrain estimates requires one to get slightly biased estimates (towards the middle) in general, on the probability (not the logit) scale.

Don't believe that machine learning methods do not make assumptions. This issue has little to do with machine learning.

Note that an individual proportion is an unbiased estimate of the true probability, hence a binary logistic model with only an intercept provides an unbiased estimate. A binary logistic model with a single predictor that has $k$ mutually exclusive categories will provide $k$ unbiased estimates of probabilities. I think that a model that capitalizes on additivity assumptions and allows the user to request estimates outside the data range (e.g., a single predictor that is continuous) will have a small bias on the probability scale so as to respect the $[0,1]$ constraint.

$\endgroup$
5
  • 4
    $\begingroup$ This seems inconsistent with Brier score being a strictly proper scoring rule. Wouldn't minimizing Brier score result in an optimal estimator? (Isn't that the very point of using a strictly proper scoring rule?) $\endgroup$
    – Dave
    Commented Dec 28, 2020 at 19:52
  • $\begingroup$ "results in suboptimal estimators" Can you explain what you mean by "suboptimal" in this particular context (under what metric)? $\endgroup$
    – user76284
    Commented Jun 16, 2023 at 17:05
  • $\begingroup$ As the sample size increases, maximum likelihood estimators have the lowest variance of the parameter estimates. Optimizing something other than the log likelihood will result in higher variances (more noise). $\endgroup$ Commented Jun 16, 2023 at 17:19
  • $\begingroup$ @FrankHarrell Then would you dismiss, say, generalized method of moments? $\endgroup$
    – Dave
    Commented Jun 13 at 5:54
  • $\begingroup$ Yes; I’d say that that method became obsolete a half of a century ago. $\endgroup$ Commented Jun 13 at 12:19
10
$\begingroup$

Although Frank Harrell's answer is correct, I think it misses the scope of the question. The answer to your question is yes, MSE would make sense in a ML nonparametric scenario. The ML equivalent of logistic regression is the linear perceptron, which makes no assumptions and does use MSE as a cost function. It uses online gradient descent for parameter training and, since it solves a convex optimisation problem, parameter estimates should be at the global optimum. The main difference between the two methods is that with the nonparametric approach you don't get confidence intervals and p-values and therefore you cannot use your model for inference, you can only use it for prediction.

The Linear Perceptron makes no probabilistic assumptions. There is the assumption on the data that it is linearly separable, but this is not an assumption on the model. MSE could be in theory affected by heteroscedasticity but in practice this effect is nullified by the activation function.

$\endgroup$
2
  • 2
    $\begingroup$ Well stated, I'll just add that in a sense logistic regression does not make probabilistic assumptions because the Bernoulli distribution is so simple that any binary outcome with independent observations has to fit it. $\endgroup$ Commented Dec 29, 2020 at 22:13
  • 1
    $\begingroup$ I’d wager that the linear perceptron requires more layers (interactions) in order to get probabilities that are legal (0-1). So it would require a much higher sample size that using the logistic form with maximum likelihood estimation. $\endgroup$ Commented Jun 13 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.