<jupyter_start><jupyter_text>Example for the Dark Machines Collider Unsupervised ChallengeThis notebook examines how plots will be made for analyzing the results of the challenge.Notebook author: <NAME> (bostdiek at g.harvard.edu)<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gs
from matplotlib.patches import Patch
from matplotlib.lines import Line2D
import matplotlib.markers as mmark
print(f'Using numpy version {np.version.version}: known to work with 1.19.1')
print(f'Using pandas version {pd.__version__}: known to work with 1.1.1')
plt.rcParams.update({'font.family': 'cmr10',
                     'font.size': 12,
                     'axes.unicode_minus': False,
                     'axes.labelsize': 12,
                     'axes.labelsize': 12,
                     'figure.figsize': (4, 4),
                     'figure.dpi': 160,
                     'mathtext.fontset': 'cm',
                     'mathtext.rm': 'serif',
                     'xtick.direction': 'in',
                     'ytick.direction': 'in',
                     'xtick.top': True,
                     'ytick.right': True
                     })<jupyter_output><empty_output><jupyter_text>Load a file<jupyter_code>df = pd.read_csv('../data/Combined.csv')
df.head()<jupyter_output><empty_output><jupyter_text>Print of all of the unique model names for the file<jupyter_code>list(df['Model'].unique())<jupyter_output><empty_output><jupyter_text>Make a box-and-whiskers plot<jupyter_code>model = 'Combined-PROD-VAE_beta1_z21-Flow'
aucs = list(df[df.Model == model]['AUC'])
sig = list(df[df.Model == model]['Signal'])
shape_dict = {0: 'o',
              1: '+',
              2: 'd',
              3: 's'
             }
for i, auc in enumerate(aucs):
    ic = i % 10
    markern = i // 10
    plt.scatter([auc], [1], c=f'C{i}', marker=shape_dict[markern], label=sig[i].replace('_', r'$\_$'))
    plt.legend(ncol=3, loc=(1.05,  0))
    
bbox1 = plt.boxplot(aucs,
                    vert=False,
                    manage_ticks=False,
                    patch_artist=True,
                    medianprops={'color':'k'},
                    positions=[2]
                   )

plt.ylim(0.5, 3)
plt.yticks([1, 2], [])
plt.xlim(-0.1, 1.1)
plt.xlabel('AUC')
plt.xticks([0, 0.25, 0.5, 0.75, 1])
q1 = np.quantile(aucs, 0.25)
q3 = np.quantile(aucs, 0.75)
qm = q1 - 1.5*(q3-q1)
plt.annotate('Median', (np.median(aucs), 2.1), (np.median(aucs), 2.8), arrowprops=dict(facecolor='black', width=1, headwidth=5), ha='center')
plt.annotate('$Q1$', (np.quantile(aucs, 0.25), 1.9), (np.quantile(aucs, 0.25), 1.4), arrowprops=dict(facecolor='black', width=1, headwidth=5), ha='center')
plt.annotate('$Q3$', (np.quantile(aucs, 0.75), 1.9), (np.quantile(aucs, 0.75), 1.4), arrowprops=dict(facecolor='black', width=1, headwidth=5), ha='center')

plt.annotate('Max', (np.max(aucs), 2.1), (np.max(aucs), 2.5), arrowprops=dict(facecolor='black', width=1, headwidth=5), ha='center')
plt.annotate(r'$Q1 - 1.5 (Q3-Q1)$', (qm, 2.1), (qm, 2.5), arrowprops=dict(facecolor='black', width=1, headwidth=5), ha='center')
plt.annotate('Outliers', (0.5, 1.9), (0.2, 1.), arrowprops=dict(facecolor='black', width=1, headwidth=5), ha='center')


plt.ylabel(model.replace('_','$\_$'))
plt.title('Example')

plt.savefig('../figures/ExampleBoxPlot.pdf', bbox_inches='tight')
plt.savefig('../figures/ExampleBoxPlot.png', bbox_inches='tight')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18093329516175208, 'fraction_numerical': 0.03721729172630976, 'mean_word_length': 3.0346420323325636, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '307835', 'license': 'MIT', 'n_tokens_mistral': 1383, 'n_tokens_neox': 1266, 'n_words': 247, 'path': 'notebooks/01-ExampleBoxAndWhiskerPlot.ipynb', 'repo_name': 'bostdiek/DarkMachines-UnsupervisedChallenge', 'size': '3500'}