parameters: (prob, binary=True)
return_statement: return np.log(_clipped_prob)
docstring: r"""Convert probability to logit form.
      For the binary case, the logit stands for log(p / (1 - p)).
      Whereas for the multinomial case, the logit denotes log(p).
docstring_summary: r"""Convert probability to logit form.
      For the binary case, the logit stands for log(p / (1 - p)).
      Whereas for the multinomial case, the logit denotes log(p).
docstring_tokens: r Convert probability to logit form . For the binary case the logit stands for log ( p / ( 1 - p )) . Whereas for the multinomial case the logit denotes log ( p ) .
function: def prob2logit(prob, binary=True):
      r"""Convert probability to logit form.
      For the binary case, the logit stands for log(p / (1 - p)).
      Whereas for the multinomial case, the logit denotes log(p).
      """
      _clipped_prob = _clip_prob(prob)
      if binary:
          return np.log(_clipped_prob) - np.log1p(-_clipped_prob)
      # The clipped prob would cause numerical error in the categorical case,
      # no idea about the reason behind.
      return np.log(_clipped_prob)
function_tokens: def prob2logit ( prob , binary = True ) : _clipped_prob = _clip_prob ( prob ) if binary : return np . log ( _clipped_prob ) - np . log1p ( - _clipped_prob ) # The clipped prob would cause numerical error in the categorical case, # no idea about the reason behind. return np . log ( _clipped_prob )