def __rating_to_prob(rating):
    """Transform a rating of 1 to 5 to a non-negatie number proportational to
    its probability of being sampled.
    """
    # Exponential scale: one step higher in rating results in twice as much as
    # likely to be sampled.
    return float(2 ** rating)