3
$\begingroup$

Using R, I used logistic regression to predict a binary target variable. But using a rule like "$<50\%$ then $0$ and $\ge 50\%$ then $1$" feels arbitrary.

How can I do that with R? I mean compute a cutoff point according to my data.

$\endgroup$
  • 1
    $\begingroup$ Why do you need a cutoff point? Logistic regression is risk estimation, not classification. Anyhow, if you really need a decision, then the cutoff cannot be determined from the daya,but from the costs associated withthe problem, and neednot be the samefor every case. Search this site for proper score function, cutoff, logistic regrwssion, and posts by @Frank Harrell $\endgroup$ – kjetil b halvorsen Mar 25 '17 at 21:16
1
$\begingroup$

That depends on what you mean by "optimal". You need to choose a loss function.

That said, as mentioned in the comments, logistic regression is a method for probabilistic classification rather than discrete classification, so if all you need as predicted output is a class, is logistic regression really what you want?

$\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.