<jupyter_start><jupyter_text>SBM<jupyter_code>if experiment_id == '1591102901':
    experiments = [x for _, x in full_df.groupby(['Lower bound'])]
    for experiment in experiments:

        fig, ax = plt.subplots(figsize=(15, 10))

        name = f"SBM_bound_theory_lb_f_{experiment['Lower bound'].iloc[0]}"

        columns = ['p', 'q', 'Adjusted Rand Score']
        data = experiment[columns].groupby(['p', 'q'], as_index=False).mean().abs()
                                                         
        make_result_heatmap(data, ax, x_column=columns[0], y_column=columns[1], values_column=columns[2], x_label='within-cluster connectivity $p$', y_label='between-cluster connectivity $q$')
        ax.set_axisbelow(True)
        fig.tight_layout()

        fig.savefig(f'{path_out / name}.svg')
        plt.close(fig) 
if experiment_id == '1589802894':
    experiments = [x for _, x in full_df.groupby(['Lower bound'])]
    for experiment in experiments:

        fig, ax = plt.subplots(figsize=(15, 10))

        name = f"SBM_bound_theory_lb_f_{experiment['Lower bound'].iloc[0]}_full_tree"

        columns = ['p', 'q', 'ars']
        data = experiment[columns].groupby(['p', 'q'], as_index=False).mean()
                                                         
        make_result_heatmap(data, ax, x_column=columns[0], y_column=columns[1], values_column=columns[2], x_label='within-cluster connectivity $p$', y_label='between-cluster connectivity $q$')
        add_lines(values_theory, ax, plot_first=True)
        ax.set_axisbelow(True)
        fig.tight_layout()

        fig.savefig(f'{path_out / name}.svg')
        plt.close(fig) 
if experiment_id == '1590679038':
    experiments = [x for _, x in full_df.groupby(['q', 'p'])]
    for experiment in experiments:

        fig, ax = plt.subplots(figsize=(15, 10))

        name = f"SBM_cuts_p_{experiment['p'].iloc[0]}_q_{experiment['q'].iloc[0]}"

        columns = ['Lower bound', 'Number of cuts', 'Adjusted Rand Score']
        data = experiment[columns].groupby(['Lower bound', 'Number of cuts'], as_index=False).mean()
        
        data.to_csv(f'{name}.csv', index=False)
                                                 
        make_result_heatmap(data, ax, x_column=columns[0], y_column=columns[1], values_column=columns[2])
        add_lines(values_theory, ax)
        ax.set_axisbelow(True)
        fig.tight_layout()

        fig.savefig(f'{path_out / name}.pdf')
        plt.close(fig)<jupyter_output><empty_output><jupyter_text>id = 1589802894<jupyter_code>if experiment_id == '1589802894':
        
    experiments = [x for _, x in full_df.groupby(['Lower bound'])]
    for experiment in experiments:

        fig, ax = plt.subplots(figsize=(22.5, 15))

        name = f"SBM_bound_theory_lb_f_{experiment['Lower bound'].iloc[0]}_full_tree"

        columns = ['p', 'q', 'ars']
        data = experiment[columns].groupby(['p', 'q'], as_index=False).mean()
                                                         
        make_result_heatmap(data, ax, x_column=columns[0], y_column=columns[1], values_column=columns[2], x_label='within-cluster probability p', y_label='between-cluster probability q')
        add_lines(values_theory, ax, plot_first=True)
        ax.set_axisbelow(True)
        fig.tight_layout()

        fig.savefig(f'{path_out / name}.svg')
        plt.close(fig)<jupyter_output><empty_output><jupyter_text>id = 1590925112<jupyter_code>if experiment_id == '1590925112':
    full_df['size'] = full_df['block_sizes'].str.extract(r'(\d+),').astype(int)
    experiments = [x for _, x in full_df.groupby(['p', 'q', 'Lower bound'])]
    for experiment in experiments:

        fig, ax = plt.subplots(figsize=(15, 10))

        name = f"SBM_bound_theory_p_{experiment['p'].iloc[0]}_q_{experiment['q'].iloc[0]}_lb_f_{experiment['Lower bound'].iloc[0]}"

        columns = [ 'size', 'agreement', 'Adjusted Rand Score']
        data = experiment[columns].groupby([ 'size', 'agreement',], as_index=False).mean()
                                                         
        make_result_heatmap(data, ax, x_column=columns[0], y_column=columns[1], values_column=columns[2], x_label='Block size $| V_i |$', y_label='Agreement $a$')
        add_lines(values_theory, ax, plot_first=True)
        ax.set_axisbelow(True)
        fig.tight_layout()

        fig.savefig(f'{path_out / name}.pdf')
        plt.close(fig)<jupyter_output><empty_output><jupyter_text>id = 1590928658<jupyter_code>if experiment_id == '1590928658':
    full_df['size'] = full_df['block_sizes'].str.extract(r'(\d+),').astype(int)
    experiments = [x for _, x in full_df.groupby(['p', 'q', 'Lower bound'])]
    for experiment in experiments:

        fig, ax = plt.subplots(figsize=(15, 10))

        name = f"SBM_bound_theory_p_{experiment['p'].iloc[0]}_q_{experiment['q'].iloc[0]}_lb_f_{experiment['Lower bound'].iloc[0]}"

        columns = [ 'percentile_orders', 'agreement', 'Adjusted Rand Score']
        data = experiment[columns].groupby([ 'percentile_orders', 'agreement',], as_index=False).mean()
                                                         
        make_result_heatmap(data, ax, x_column=columns[0], y_column=columns[1], values_column=columns[2], x_label='percentile of orders considered', y_label='agreement')
        add_lines(values_theory, ax, plot_first=True)
        ax.set_axisbelow(True)
        fig.tight_layout()

        fig.savefig(f'{path_out / name}.pdf')
        plt.close(fig)<jupyter_output><empty_output><jupyter_text>id = 1590935943<jupyter_code>full_df['percentile_orders'].unique()
if experiment_id == '1590935943':
    experiments = [x for _, x in full_df.groupby(['p', 'q', 'percentile_orders'])]
    for experiment in experiments:

        fig, ax = plt.subplots(figsize=(15, 10))

        name = f"SBM_bound_theory_p_{experiment['p'].iloc[0]}_q_{experiment['q'].iloc[0]}_per_{experiment['percentile_orders'].iloc[0]}"

        columns = [ 'Lower bound', 'Number of cuts', 'Adjusted Rand Score']
        data = experiment[columns].groupby(['Lower bound', 'Number of cuts'], as_index=False).mean()
                                                         
        make_result_heatmap(data, ax, x_column=columns[0], y_column=columns[1], values_column=columns[2], x_label='lower bound', y_label='Number of cuts')
        ax.set_axisbelow(True)
        fig.tight_layout()

        fig.savefig(f'{path_out / name}.pdf')
        plt.close(fig)<jupyter_output><empty_output><jupyter_text>id = 1590934402<jupyter_code>if experiment_id == '1590934402':
    
    full_df['size'] = full_df['block_sizes'].str.extract(r', (\d+)').astype(int)
    experiments = [x for _, x in full_df.groupby(['p', 'q', 'percentile_orders'])]
    for experiment in experiments:

        fig, ax = plt.subplots(figsize=(15, 10))

        name = f"SBM_bound_theory_p_{experiment['p'].iloc[0]}_q_{experiment['q'].iloc[0]}_per_{experiment['percentile_orders'].iloc[0]}"

        columns = [ 'size', 'Lower bound',  'Adjusted Rand Score']
        data = experiment[columns].groupby(['size', 'Lower bound'], as_index=False).mean()
                                                         
        make_result_heatmap(data, ax, x_column=columns[0], y_column=columns[1], values_column=columns[2], x_label='block size $| V_i |$', y_label='lower bound')
        ax.set_axisbelow(True)
        fig.tight_layout()

        fig.savefig(f'{path_out / name}.pdf')
        plt.close(fig)<jupyter_output><empty_output><jupyter_text>id = 1591003301<jupyter_code>if experiment_id == '1591014530':
    experiments = [x for _, x in full_df.groupby(['p', 'q'])]
    for experiment in experiments:

        fig, ax = plt.subplots(figsize=(15, 10))

        name = f"SBM_bound_theory_p_{experiment['p'].iloc[0]}_q_{experiment['q'].iloc[0]}"

        columns = [ 'agreement', 'percentile_orders',  'Adjusted Rand Score']
        data = experiment[columns].groupby(['agreement', 'percentile_orders'], as_index=False).mean()
                                                         
        make_result_heatmap(data, ax, x_column=columns[0], y_column=columns[1], values_column=columns[2], x_label='agreement $a$', y_label='percentile of orders')
        ax.set_axisbelow(True)
        fig.tight_layout()

        fig.savefig(f'{path_out / name}.pdf')
        plt.close(fig) 
full_df
if experiment_id == '1591037064':
    experiments = [x for _, x in full_df.groupby(['p', 'q'])]
    for experiment in experiments:

        fig, ax = plt.subplots(figsize=(20, 13))

        name = f"SBM_bound_theory_p_{experiment['p'].iloc[0]}_q_{experiment['q'].iloc[0]}_lb_0.2"

        columns = [ 'agreement', 'percentile_orders',  'Adjusted Rand Score']
        data = experiment[columns].groupby(['agreement', 'percentile_orders'], as_index=False).mean()
                                                         
        make_result_heatmap(data, ax, x_column=columns[0], y_column=columns[1], values_column=columns[2], x_label='agreement $a$', y_label='percentile of costs')
        ax.set_axisbelow(True)
        fig.tight_layout()

        fig.savefig(f'{path_out / name}.svg')
        plt.close(fig) 
full_df[full_df['agreement'] == 20].groupby('percentile_orders').mean()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15442846328538987, 'fraction_numerical': 0.027684654482534876, 'mean_word_length': 3.1157098353360038, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '160204', 'license': 'MIT', 'n_tokens_mistral': 3244, 'n_tokens_neox': 2991, 'n_words': 498, 'path': 'notebooks/Plot SBM.ipynb', 'repo_name': 'dfioravanti/tangles', 'size': '9247'}