Given a classifier $C$ that gets text as an input and outputs a posterior distribution $p_1\dots p_n$ on $n$ possible topics.

In other words, for each user post, I have a list of probabilities $\{p_i\}$ that represent the chance that the user was writing about topic $i$.

I would like to calculate weights $w_i=f(p_i)$ such that the weight would be negative if the user is very not likely to write about a topic, and positive if the user is very likely to write about a topic.

What would be the standard way to do this transformation ?


1 Answer 1


You could use the Logit function as a start, i.e

$$ w_i = \log \left( \frac{p_i}{1-p_i}\right)$$

The weights will have a range of about $[-8, 8]$

  • $\begingroup$ I was thinking about using the logit but I quite alot of time $p_i$ is very close to zero, which causes the weights to explode to negative infinity $\endgroup$
    – Uri Goren
    Apr 5, 2016 at 16:15

Your Answer

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

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