def compute_mixture_group_errors()

in src/minmaxML.py [0:0]


def compute_mixture_group_errors(numgroups, errors, index, groupsize, total_steps=None):
    """
    Computes the performance of the aggregate mixture model across all rounds w.r.t individual groups using the errors
    of the individual model from each round.
    """
    numsteps, numsamples = errors.shape

    # Decrease numsteps if we converged early
    if total_steps is not None:
        numsteps = total_steps

    grouperrs = np.zeros((numsteps, numgroups))  # Errors within each groups over rounds
    agg_grouperrs = np.zeros((numsteps, numgroups))  # Mixture model errors for each groups over rounds

    for t in range(1, numsteps):
        update_group_errors(numgroups, t, errors, grouperrs, agg_grouperrs, index, groupsize)
    return agg_grouperrs[1:]