示例#1
0
                                         label_n=LABEL_N):

    pattern = f'dp_{DP_PROBES_NAME}_{METRIC}.csv'
    for p in param_path.rglob(pattern):
        s = pd.read_csv(p, index_col=0, squeeze=True)
        n = 1
        y_mean = s.values
        h = np.zeros((len(s)))  # margin of error

        # collect for comparison figure
        summary = (s.index.values, y_mean, h, label, n)
        summaries.append(summary)

    if not summaries:
        raise RuntimeError(f'Did not find csv files matching {pattern}')

# plot comparison
fig = make_summary_fig(
    summaries,
    ylabel=Y_LABEL,
    title=TITLE,
    log_y=LOG_Y,
    ylims=Y_LIMS,
    xlims=X_LIMS,
    figsize=FIG_SIZE,
    legend_loc='best',
    # vline=200_000,
    # legend_labels=['reverse age-ordered', 'age-ordered'],
    # palette_ids=[0, 1],  # re-assign colors to each line
)
fig.show()
示例#2
0
    print(f'--------------------- End section {p.name}')
    print()

# sort data
summaries = sorted(summaries, key=lambda s: s[1][-1], reverse=True)
if not summaries:
    raise SystemExit('No data found')

# print to console
for s in summaries:
    _, y_mean, y_std, label, n = s
    print(label)
    print(y_mean)
    print(y_std)
    print()

# plot
fig = make_summary_fig(
    summaries,
    Y_LABEL,
    title=TITLE,
    palette_ids=PALETTE_IDS,
    figsize=FIG_SIZE,
    ylims=Y_LIMS,
    legend_labels=LABELS,
    vlines=V_LINES,
    plot_max_lines=PLOT_MAX_LINES,
    plot_max_line=PLOT_MAX_LINE,
    legend_loc='best',
)
fig.show()
示例#3
0
    concatenated_df = pd.concat(series_list, axis=1)
    y_mean = concatenated_df.mean(axis=1).values.flatten()
    y_sem = sem(concatenated_df.values, axis=1)
    h = y_sem * t.ppf((1 + CONFIDENCE) / 2, n - 1)  # margin of error

    return concatenated_df.index.values, y_mean, h, lb, n


summaries = []
project_name = __name__
for param_path, label in gen_param_paths(project_name,
                                         param2requests,
                                         param2default,
                                         runs_path=RUNS_PATH,
                                         ludwig_data_path=LUDWIG_DATA_PATH,
                                         label_n=LABEL_N):
    summary = make_summary(param_path, label, f'*_{PROBES_NAME}_js.csv')
    summaries.append(summary)

fig = make_summary_fig(
    summaries,
    ylabel='Noun ' + Y_LABEL,
    title='',
    log_y=LOG_Y,
    ylims=Y_LIMS,
    figsize=FIG_SIZE,
    legend_loc='best',
    vline=200_000,
    palette_ids=[0, 1],  # re-assign colors to each line
)
fig.show()