def accumulate_covariance_estimators(data, C):

    V = C.shape[0]
    N = data.shape[0]
    D = data.shape[1]

    # Essential variables
    A = np.zeros((V, D, D))                 # accumulators for covariance estimator per cluster
    mu = np.zeros((V, D))                   # residual means
    count = np.zeros(V, dtype=int)          # count of points per cluster
    assignments = np.zeros(N, dtype=int)    # point cluster assignments
    residuals = np.zeros((N, D))            # residual for data points given cluster assignment

    # Iterate data points, accumulate estimators
    for i in xrange(N):
        d = data[i]

        # Find cluster assignment and residual
        cluster = predict_cluster(d, C)
        centroid = C[cluster]
        residual = d - centroid
        assignments[i] = cluster

        # Accumulate estimators for covariance matrix for the assigned cluster
        mu[cluster] += residual
        count[cluster] += 1
        A[cluster] += np.outer(residual, residual)
        residuals[i] = residual

    return A, mu, count, assignments, residuals
Load the form.
dataset/ETHPy150Open yahoo/lopq/python/lopq/model.py/accumulate_covariance_estimators--crossover with--dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/admin/forms.py/AuthenticationSettingsForm.load