<jupyter_start><jupyter_text>Plotting active learning Imports  Plot results.<jupyter_code>import pandas as pd
import os
rep = 'GraphConv'
home_dir = './results/comparison_results/'
home_dir_list = os.listdir(home_dir)

folders = [h for h in home_dir_list if 'gp' in h]
paths = [f'{home_dir}/{f}/best_{rep}_Adam.csv' for f in folders]
best_df_mle = pd.concat([pd.read_csv(p, index_col=0) for p in paths])
best_df_mle['Number of Candidates Acquired'] = best_df_mle['Step']

folders = [h for h in home_dir_list if 'mle' in h]
paths = [f'{home_dir}/{f}/best_{rep}_Adam.csv' for f in folders]
best_df_gp = pd.concat([pd.read_csv(p, index_col=0) for p in paths])
best_df_gp['Number of Candidates Acquired'] = best_df_gp['Step']

# # fix column titles
# best_df_gp['Acquisition Function'].loc[best_df_gp['Acquisition Function'] == 'random'] = 'Random'
# best_df_gp['Acquisition Function'].loc[best_df_gp['Acquisition Function'] == 'expected improvement'] = 'Expected Improvement'
# best_df_gp['Acquisition Function'].loc[best_df_gp['Acquisition Function'] == 'probability of improvement'] = 'Probability of Improvement'
# best_df_gp['Acquisition Function'].loc[best_df_gp['Acquisition Function'] == 'upper confidence bound'] = 'Upper Confidence Bound'<jupyter_output><empty_output><jupyter_text>Bringing them together.<jupyter_code>best_df_mle['type'] = 'MLE'
best_df_gp['type'] = 'GP'
best_df = pd.concat([best_df_mle, best_df_gp])<jupyter_output><empty_output><jupyter_text>Grid format!<jupyter_code>import matplotlib.pyplot as plt
import seaborn as sns

from matplotlib import cm as cm
colors = plt.get_cmap('tab10')
plt.rc('font', family='serif', size=12)
plt.rc('xtick', labelsize=10)
plt.rc('ytick', labelsize=10)

sns.set_palette('tab10')

plot = sns.relplot(x="Number of Candidates Acquired", y="Regret",
                   col="Acquisition Function", hue="Acquisition Function",
                   kind="line",
                   style="type", # comment out if not comparing
                   data=best_df)

# comment out if not comparing
h, l = plot.axes[0][0].get_legend_handles_labels()
plot._legend.remove()
plot.add_legend(handles=h[-2:], labels=l[-2:])<jupyter_output>c:\users\micha\miniconda3\envs\pinot\lib\site-packages\seaborn\axisgrid.py:100: UserWarning: You have mixed positional and keyword arguments, some input may be discarded.
  figlegend = self.fig.legend(handles, labels, **kwargs)
{'fraction_non_alphanumeric': 0.14143094841930118, 'fraction_numerical': 0.008319467554076539, 'mean_word_length': 5.793785310734464, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '325092', 'license': 'MIT', 'n_tokens_mistral': 889, 'n_tokens_neox': 839, 'n_words': 184, 'path': 'scripts/active/plotting_active_clean.ipynb', 'repo_name': 'choderalab/pinot', 'size': '2404'}