def compute_residuals(data, C):
    assignments = np.apply_along_axis(predict_cluster, 1, data, C)
    residuals = data - C[assignments]
    return residuals, assignments
dataset/ETHPy150Open yahoo/lopq/python/lopq/model.py/compute_residuals/original