Hacker News new | ask | show | jobs
by mnky9800n 2994 days ago
Logistic regression is doing classification not regression. That is, it's assigning/predicting categories of data points instead of predicting some continuous value on some interval. Maybe this is splitting hairs but the way you evaluate a classification model is totally different than a regression one.
2 comments

This is not correct. Logistic regression can be used for classification, true, but it can also be viewed as a way of estimating the conditional mean of an outcome variable that has a Bernoulli, or binomial distribution, depending on the formulation.

There are many ways to evaluate all of these methods, and for classification you may favor something else, but it's completely reasonable to use the (cross validated, or not) empirical risk for both logistic and linear regression. That would be a negative log likelihood in both cases, from the Bernoulli/binomial distribution for logistic regression or the normal distribution for linear regression.

This is a question of perspective, you can in fact just take it as a regression over the continuous 0-1 interval with loss |y-o(Xw)| where o is the sigmoid and could report that loss (in fact a package such as Sklearn will usually return the parameter values that minimise that loss, possibly with a penalty). If you want to use it as a classifier then you threshold the predictions.