Estimate the cluster centers for each cluster.

def estimate_reduce(interface, state, label, inp):
    """Estimate the cluster centers for each cluster."""
    centers = {}
    for i, c in inp:
        centers[i] = c if i not in centers else state['update'](centers[i], c)

    out = interface.output(0)
    for i, c in centers.items():
        out.add(i, state['finalize'](c))