(sig_df, effect_df, p_threshold=0.05, simplify=True)
return fig
Significance matrix to compare pipelines

    Visualize significances as a heatmap with green/grey/red for significantly
    higher/significantly lower.

    Parameters
    ----------
    sig_df: DataFrame
        DataFrame of pipeline x pipeline where each value is a p-value,
    effect_df: DataFrame
        DataFrame where each value is an effect size

    Returns
    -------
    fig: Figure
        Pyplot handle
Significance matrix to compare pipelines
Significance matrix to compare pipelines
def summary_plot(sig_df, effect_df, p_threshold=0.05, simplify=True):
    """Significance matrix to compare pipelines

    Visualize significances as a heatmap with green/grey/red for significantly
    higher/significantly lower.

    Parameters
    ----------
    sig_df: DataFrame
        DataFrame of pipeline x pipeline where each value is a p-value,
    effect_df: DataFrame
        DataFrame where each value is an effect size

    Returns
    -------
    fig: Figure
        Pyplot handle
    """
    if simplify:
        effect_df.columns = effect_df.columns.map(_simplify_names)
        sig_df.columns = sig_df.columns.map(_simplify_names)
    annot_df = effect_df.copy()
    for row in annot_df.index:
        for col in annot_df.columns:
            if effect_df.loc[row, col] > 0:
                txt = "{:.2f}\np={:1.0e}".format(
                    effect_df.loc[row, col], sig_df.loc[row, col]
                )
            else:
                # we need the effect direction and p-value to coincide.
                # TODO: current is hack
                if sig_df.loc[row, col] < p_threshold:
                    sig_df.loc[row, col] = 1e-110
                txt = ""
            annot_df.loc[row, col] = txt
    fig = plt.figure()
    ax = fig.add_subplot(111)
    palette = sea.light_palette("green", as_cmap=True)
    palette.set_under(color=[1, 1, 1])
    palette.set_over(color=[0.5, 0, 0])
    sea.heatmap(
        data=-np.log(sig_df),
        annot=annot_df,
        fmt="",
        cmap=palette,
        linewidths=1,
        linecolor="0.8",
        annot_kws={"size": 10},
        cbar=False,
        vmin=-np.log(0.05),
        vmax=-np.log(1e-100),
    )
    for lb in ax.get_xticklabels():
        lb.set_rotation(45)
    ax.tick_params(axis="y", rotation=0.9)
    ax.set_title("Algorithm comparison")
    plt.tight_layout()
    return fig
def summary_plot ( sig_df , effect_df , p_threshold = 0.05 , simplify = True ) : if simplify : effect_df . columns = effect_df . columns . map ( _simplify_names ) sig_df . columns = sig_df . columns . map ( _simplify_names ) annot_df = effect_df . copy ( ) for row in annot_df . index : for col in annot_df . columns : if effect_df . loc [ row , col ] > 0 : txt = "{:.2f}\np={:1.0e}" . format ( effect_df . loc [ row , col ] , sig_df . loc [ row , col ] ) else : # we need the effect direction and p-value to coincide. # TODO: current is hack if sig_df . loc [ row , col ] < p_threshold : sig_df . loc [ row , col ] = 1e-110 txt = "" annot_df . loc [ row , col ] = txt fig = plt . figure ( ) ax = fig . add_subplot ( 111 ) palette = sea . light_palette ( "green" , as_cmap = True ) palette . set_under ( color = [ 1 , 1 , 1 ] ) palette . set_over ( color = [ 0.5 , 0 , 0 ] ) sea . heatmap ( data = - np . log ( sig_df ) , annot = annot_df , fmt = "" , cmap = palette , linewidths = 1 , linecolor = "0.8" , annot_kws = { "size" : 10 } , cbar = False , vmin = - np . log ( 0.05 ) , vmax = - np . log ( 1e-100 ) , ) for lb in ax . get_xticklabels ( ) : lb . set_rotation ( 45 ) ax . tick_params ( axis = "y" , rotation = 0.9 ) ax . set_title ( "Algorithm comparison" ) plt . tight_layout ( ) return fig