def _mm_rankings(n_items, data, params):
weights = exp_transform(params)<EOL>wins = np.zeros(n_items, dtype=float)<EOL>denoms = np.zeros(n_items, dtype=float)<EOL>for ranking in data:<EOL><INDENT>sum_ = weights.take(ranking).sum()<EOL>for i, winner in enumerate(ranking[:-<NUM_LIT:1>]):<EOL><INDENT>wins[winner] += <NUM_LIT:1><EOL>val = <NUM_LIT:1.0> / sum_<EOL>for item in ranking[i:]:<EOL><INDENT>denoms[item] += val<EOL><DEDENT>sum_ -= weights[winner]<EOL><DEDENT><DEDENT>return wins, denoms<EOL>
Inner loop of MM algorithm for ranking data.