0
$\begingroup$

It is true that the threshold value of a logistic regression hypothesis has an effect on the Precision/Recall metrics.

Suppose you have trained a logistic regression classifier which is outputting $h_\theta(x)$

Currently, you predict $1$ if $h_\theta(x) \geq \text{threshold}$, and predict $0$ if $h_θ(x)<threshold$.

Higher the threshold, the higher the precision. Lower the threshold, the higher the recall.

This happens due to the Precision/ Recall trade-off.

But, does the threshold affect the accuracy at all?

$\endgroup$
  • 1
    $\begingroup$ Let's make 4 classifications. A and B are category 0, while C an D are category 1. Our model gives P(A=1) = 0.1, P(B=1) = 0.4, P(C=1) = 0.6, and P(D=1) = 0.9. Set the threshold to 0.5, and you get 100% accuracy. Set the threshold to 0.3, and you get 75% accuracy. $\endgroup$ – Dave May 24 at 11:30
0
$\begingroup$

Yes. If you set the threshold to $1$, then the classifier will always predict 0, which will make its accuracy $p(y = 0)$; if you set the threshold to $0$, the classifier will always predict 1, and have accuracy $p(y = 1)$; in between, it will go through various different values.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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