(df, order=None)
return out
Compute Wilcoxon rank-sum test on agregated results

    Returns kxk matrix of p-values computed via the Wilcoxon rank-sum 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 Wilcoxon rank-sum test on agregated results
Compute Wilcoxon rank - sum test on agregated results
def compute_pvals_wilcoxon(df, order=None):
    """Compute Wilcoxon rank-sum test on agregated results

    Returns kxk matrix of p-values computed via the Wilcoxon rank-sum 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

    out = np.zeros((len(df.columns), len(df.columns)))
    for i in range(len(order)):
        for j in range(len(order)):
            if i != j:
                pipe1 = order[i]
                pipe2 = order[j]
                p = stats.wilcoxon(df.loc[:, pipe1], df.loc[:, pipe2])[1]
                p /= 2
                # we want the one-tailed p-value
                diff = (df.loc[:, pipe1] - df.loc[:, pipe2]).mean()
                if diff < 0:
                    p = 1 - p  # was in the other side of the distribution
                out[i, j] = p
    return out
def compute_pvals_wilcoxon ( 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 out = np . zeros ( ( len ( df . columns ) , len ( df . columns ) ) ) for i in range ( len ( order ) ) : for j in range ( len ( order ) ) : if i != j : pipe1 = order [ i ] pipe2 = order [ j ] p = stats . wilcoxon ( df . loc [ : , pipe1 ] , df . loc [ : , pipe2 ] ) [ 1 ] p /= 2 # we want the one-tailed p-value diff = ( df . loc [ : , pipe1 ] - df . loc [ : , pipe2 ] ) . mean ( ) if diff < 0 : p = 1 - p # was in the other side of the distribution out [ i , j ] = p return out