[C++] Log-odds representation
Log to Probability
μμκ³Ό μ½λ ꡬν
\[p(x) = 1 - \frac{1}{1 + e^l(x)}\]double l2p(double l)
{
return 1 - (1.0 / (1 + exp(l)));
}
Probability to Log
μμκ³Ό μ½λ ꡬν
double p2l(double p)
{
return log(p / (1 - p));
}
Leave a comment