(df, order=None)
return p
Compute permutation test on agregated results

    Returns kxk matrix of p-values computed via permutation test,
    order defines the order of rows and columns

    Parameters
    ----------
    df: DataFrame
        Aggregated results, samples are index, columns are pipelines,
        and values are scores
    order: list
        list of length (num algorithms) with names corresponding to df columns

    Returns
    -------
    pvals: ndarray of shape (n_pipelines, n_pipelines)
        array of pvalues
Compute permutation test on agregated results
Compute permutation test on agregated results
def compute_pvals_perm(df, order=None):
    """Compute permutation test on agregated results

    Returns kxk matrix of p-values computed via permutation test,
    order defines the order of rows and columns

    Parameters
    ----------
    df: DataFrame
        Aggregated results, samples are index, columns are pipelines,
        and values are scores
    order: list
        list of length (num algorithms) with names corresponding to df columns

    Returns
    -------
    pvals: ndarray of shape (n_pipelines, n_pipelines)
        array of pvalues
    """
    if order is None:
        order = df.columns
    else:
        errormsg = "provided order does not have all columns of dataframe"
        assert set(order) == set(df.columns), errormsg
    # reshape df into matrix (sub, k, k) of differences
    data = np.zeros((df.shape[0], len(order), len(order)))
    for i in range(len(order) - 1):
        for j in range(i + 1, len(order)):
            pipe1 = order[i]
            pipe2 = order[j]
            data[:, i, j] = df.loc[:, pipe1] - df.loc[:, pipe2]
            data[:, j, i] = df.loc[:, pipe2] - df.loc[:, pipe1]
    if data.shape[0] > 13:
        p = _pairedttest_random(data, 10000)
    else:
        p = _pairedttest_exhaustive(data)
    return p
def compute_pvals_perm ( df , order = None ) : if order is None : order = df . columns else : errormsg = "provided order does not have all columns of dataframe" assert set ( order ) == set ( df . columns ) , errormsg # reshape df into matrix (sub, k, k) of differences data = np . zeros ( ( df . shape [ 0 ] , len ( order ) , len ( order ) ) ) for i in range ( len ( order ) - 1 ) : for j in range ( i + 1 , len ( order ) ) : pipe1 = order [ i ] pipe2 = order [ j ] data [ : , i , j ] = df . loc [ : , pipe1 ] - df . loc [ : , pipe2 ] data [ : , j , i ] = df . loc [ : , pipe2 ] - df . loc [ : , pipe1 ] if data . shape [ 0 ] > 13 : p = _pairedttest_random ( data , 10000 ) else : p = _pairedttest_exhaustive ( data ) return p