<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _mm_top1(n_items, data, params):
 """Inner loop of MM algorithm for top1 data."""

    weights = exp_transform(params)
    wins = np.zeros(n_items, dtype=float)
    denoms = np.zeros(n_items, dtype=float)
    for winner, losers in data:
        wins[winner] += 1
        val = 1 / (weights.take(losers).sum() + weights[winner])
        for item in itertools.chain([winner], losers):
            denoms[item] += val
    return wins, denoms