(ids, prob)
return sum_result
Accumulate results per study (because one study has many SAX slices),
    so the averaged CDF for all slices is returned.
Accumulate results per study (because one study has many SAX slices),
    so the averaged CDF for all slices is returned.
Accumulate results per study ( because one study has many SAX slices ) so the averaged CDF for all slices is returned .
def accumulate_study_results(ids, prob):
    """
    Accumulate results per study (because one study has many SAX slices),
    so the averaged CDF for all slices is returned.
    """
    sum_result = {}
    cnt_result = {}
    size = prob.shape[0]
    for i in range(size):
        study_id = ids[i]
        idx = int(study_id)
        if idx not in cnt_result:
            cnt_result[idx] = 0.
            sum_result[idx] = np.zeros((1, prob.shape[1]), dtype=np.float32)
        cnt_result[idx] += 1
        sum_result[idx] += prob[i, :]
    for i in cnt_result.keys():
        sum_result[i][:] /= cnt_result[i]
    return sum_result
def accumulate_study_results ( ids , prob ) : sum_result = { } cnt_result = { } size = prob . shape [ 0 ] for i in range ( size ) : study_id = ids [ i ] idx = int ( study_id ) if idx not in cnt_result : cnt_result [ idx ] = 0. sum_result [ idx ] = np . zeros ( ( 1 , prob . shape [ 1 ] ) , dtype = np . float32 ) cnt_result [ idx ] += 1 sum_result [ idx ] += prob [ i , : ] for i in cnt_result . keys ( ) : sum_result [ i ] [ : ] /= cnt_result [ i ] return sum_result