<jupyter_start><jupyter_text>Load Data<jupyter_code>data_path = '/Users/christopherwmurphy/Documents/projects/lhc_olympics/LHC-Olympics-2020/data_processed'
df = pd.read_hdf(os.path.join(data_path, 'processed_labeled.h5'), key='processed')
df.head()
df.info(memory_usage='deep')
df.corr()['is_signal'].sort_values()<jupyter_output><empty_output><jupyter_text>Plot Features  MassesWith a bump this large no machine learning is necessary<jupyter_code>plt.figure(1, figsize=(9, 9))

plt.hist(df['mass_jj'], bins=np.arange(2150, 5650, 100), alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['mass_jj'], bins=np.arange(2150, 5650, 100), alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['mass_jj'], bins=np.arange(2150, 5650, 100), alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$m_{JJ}\, \rm [GeV]$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend(loc='upper right')

plt.tight_layout(True)
plt.show()<jupyter_output><empty_output><jupyter_text>Jets are sorted by $p_T$, so sometimes the heavier jet is $j_2$<jupyter_code>image_dir = '/Users/christopherwmurphy/Documents/projects/lhc_olympics/LHC-Olympics-2020/images'
plt.figure(7, figsize=(12, 12))

plt.subplot(2, 2, 1)
plt.hist(df['mass_1'], bins=np.arange(-25, 1025, 50), alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['mass_1'], bins=np.arange(-25, 1025, 50), alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['mass_1'], bins=np.arange(-25, 1025, 50), alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$m_1\, \rm [GeV]$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend(loc='upper right')

plt.subplot(2, 2, 2)
plt.hist(df['mass_2'], bins=np.arange(-25, 1025, 50), alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['mass_2'], bins=np.arange(-25, 1025, 50), alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['mass_2'], bins=np.arange(-25, 1025, 50), alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$m_2\, \rm [GeV]$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend(loc='upper right')

plt.subplot(2, 2, 3)
plt.hist(np.abs(df['mass_1'] - df['mass_2']), bins=np.arange(-25, 1025, 50), alpha=0.4, label=r'$\rm signal+background$')
plt.hist(np.abs(df[df['is_signal'] == 0]['mass_1'] - df[df['is_signal'] == 0]['mass_2']), bins=np.arange(-25, 1025, 50), alpha=0.4, label=r'$\rm background$')
plt.hist(np.abs(df[df['is_signal'] == 1]['mass_1'] - df[df['is_signal'] == 1]['mass_2']), bins=np.arange(-25, 1025, 50), alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$|m_1 - m_2|\, \rm [GeV]$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend(loc='upper right')

plt.subplot(2, 2, 4)
plt.hist(df['mass_1'] + df['mass_2'], bins=np.arange(-25, 1025, 50), alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['mass_1'] + df[df['is_signal'] == 0]['mass_2'], bins=np.arange(-25, 1025, 50), alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['mass_1'] + df[df['is_signal'] == 1]['mass_2'], bins=np.arange(-25, 1025, 50), alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$m_1 + m_2\, \rm [GeV]$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend(loc='upper right')

plt.tight_layout(True)
plt.savefig(os.path.join(image_dir, 'masses.png'))
plt.show()<jupyter_output><empty_output><jupyter_text>$p_T$<jupyter_code>plt.figure(2, figsize=(12, 6))

plt.subplot(1, 2, 1)
plt.hist(df['pt_1'], bins=np.arange(1150, 2550, 100), alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['pt_1'], bins=np.arange(1150, 2550, 100), alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['pt_1'], bins=np.arange(1150, 2550, 100), alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$p_T^{j_1}\, \rm [GeV]$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.subplot(1, 2, 2)
plt.hist(df['pt_2'], bins=np.arange(450, 2050, 100), alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['pt_2'], bins=np.arange(450, 2050, 100), alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['pt_2'], bins=np.arange(450, 2050, 100), alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$p_T^{j_2}\, \rm [GeV]$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.tight_layout(True)
plt.show()<jupyter_output><empty_output><jupyter_text>$\eta$, $\phi$The pseudorapidity may have a small amount of discriminating power<jupyter_code>plt.figure(3, figsize=(12, 12))

plt.subplot(2, 2, 1)
plt.hist(df['eta_1'], alpha=0.4, density=True, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['eta_1'], alpha=0.4, density=True, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['eta_1'], alpha=0.4, density=True, label=r'$\rm signal$')
plt.xlabel(r'$\eta_1$')
plt.ylabel(r'$\rm Relative\, number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 2)
plt.hist(df['eta_2'], alpha=0.4, density=True, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['eta_2'], alpha=0.4, density=True, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['eta_2'], alpha=0.4, density=True, label=r'$\rm signal$')
plt.xlabel(r'$\eta_2$')
plt.ylabel(r'$\rm Relative\, number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 3)
plt.hist(df['phi_1'], alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['phi_1'], alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['phi_1'], alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$\phi_1$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 4)
plt.hist(df['phi_2'], alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['phi_2'], alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['phi_2'], alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$\phi_2$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.tight_layout(True)
plt.show()<jupyter_output><empty_output><jupyter_text>$N$-subjetiness<jupyter_code>plt.figure(4, figsize=(12, 12))

plt.subplot(2, 2, 1)
plt.hist(df['sqrt(tau1(2))/tau1(1)_1'], range=(1, 7), alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['sqrt(tau1(2))/tau1(1)_1'], range=(1, 7), alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['sqrt(tau1(2))/tau1(1)_1'], range=(1, 7), alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$\left[\sqrt(\tau_1^{(2)})/\tau_1^{(1)}\right]_{j_1}$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 2)
plt.hist(df['sqrt(tau1(2))/tau1(1)_2'], range=(1, 7), alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['sqrt(tau1(2))/tau1(1)_2'], range=(1, 7), alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['sqrt(tau1(2))/tau1(1)_2'], range=(1, 7), alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$\left[\sqrt(\tau_1^{(2)})/\tau_1^{(1)}\right]_{j_2}$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 3)
plt.hist(df['tau21_1'], alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['tau21_1'], alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['tau21_1'], alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$(\tau_{21})_{j_1}$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 4)
plt.hist(df['tau21_2'], alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['tau21_2'], alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['tau21_2'], alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$(\tau_{21})_{j_2}$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.tight_layout(True)
plt.show()<jupyter_output><empty_output><jupyter_text>Each of the lighter exotic particles decays to dijets, so it makes sense that the $n$-subjetiness observables with higher $n$ are less effective discriminators<jupyter_code>plt.figure(5, figsize=(12, 12))

plt.subplot(2, 2, 1)
plt.hist(df['tau32_1'], alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['tau32_1'], alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['tau32_1'], alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$(\tau_{32})_{j_1}$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 2)
plt.hist(df['tau32_2'], alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['tau32_2'], alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['tau32_2'], alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$(\tau_{32})_{j_2}$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 3)
plt.hist(df['tau43_1'], alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['tau43_1'], alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['tau43_1'], alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$(\tau_{43})_{j_1}$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 4)
plt.hist(df['tau43_2'], alpha=0.4, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['tau43_2'], alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['tau43_2'], alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$(\tau_{43})_{j_2}$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.tight_layout(True)
plt.show()<jupyter_output><empty_output><jupyter_text>Quark / Gluon discriminationHere the background is more likely to be outlying. This is not useful for outlier detection, but could be useful for classification<jupyter_code>plt.figure(6, figsize=(12, 12))

plt.subplot(2, 2, 1)
plt.hist(df['fragmentation_1'], alpha=0.4, density=True, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['fragmentation_1'], density=True, alpha=0.4, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['fragmentation_1'], density=True, alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$j_1 \, \rm fragmentation$')
plt.ylabel(r'$\rm Relative\, number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 2)
plt.hist(df['fragmentation_2'], alpha=0.4, density=True, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['fragmentation_2'], alpha=0.4, density=True, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['fragmentation_2'], alpha=0.4, density=True, label=r'$\rm signal$')
plt.xlabel(r'$j_2 \, \rm fragmentation$')
plt.ylabel(r'$\rm Relative\, number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 3)
plt.hist(df['multiplicity_1'], alpha=0.4, density=True, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['multiplicity_1'], alpha=0.4, density=True, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['multiplicity_1'], alpha=0.4, density=True, label=r'$\rm signal$')
plt.xlabel(r'$j_1 \, \rm multiplicity$')
plt.ylabel(r'$\rm Relative\, number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 4)
plt.hist(df['multiplicity_2'], alpha=0.4, density=True, label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['multiplicity_2'], alpha=0.4, density=True, label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['multiplicity_2'], alpha=0.4, density=True, label=r'$\rm signal$')
plt.xlabel(r'$j_2 \, \rm multiplicity$')
plt.ylabel(r'$\rm Relative\, number\, of\, events$')
plt.legend()

plt.tight_layout(True)
plt.show()<jupyter_output><empty_output><jupyter_text>Dijet ObservablesAgain, the signal is not outlying here<jupyter_code>plt.figure(8, figsize=(12, 12))

plt.subplot(2, 2, 1)
plt.hist(df['delta_phi_jj'], alpha=0.4, range=(3*np.pi/4, np.pi), label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['delta_phi_jj'], alpha=0.4, range=(3*np.pi/4, np.pi), label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['delta_phi_jj'], alpha=0.4, range=(3*np.pi/4, np.pi), label=r'$\rm signal$')
plt.xlabel(r'$\Delta\phi_{jj}$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 2)
plt.hist(df['delta_R_jj'], alpha=0.4, range=(2.0, 5.0), label=r'$\rm signal+background$')
plt.hist(df[df['is_signal'] == 0]['delta_R_jj'], alpha=0.4, range=(2.0, 5.0), label=r'$\rm background$')
plt.hist(df[df['is_signal'] == 1]['delta_R_jj'], alpha=0.4, range=(2.0, 5.0), label=r'$\rm signal$')
plt.xlabel(r'$\Delta R_{jj}$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 3)
plt.hist(np.pi - df['delta_phi_jj'], alpha=0.4, range=(0, 1), label=r'$\rm signal+background$')
plt.hist(np.pi - df[df['is_signal'] == 0]['delta_phi_jj'], range=(0, 1), alpha=0.4, label=r'$\rm background$')
plt.hist(np.pi - df[df['is_signal'] == 1]['delta_phi_jj'], range=(0, 1), alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$\pi - \Delta\phi_{jj}$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.subplot(2, 2, 4)
plt.hist(np.sqrt(df['delta_R_jj']**2 - df['delta_phi_jj']**2), alpha=0.4, label=r'$\rm signal+background$')
plt.hist(np.sqrt(df[df['is_signal'] == 0]['delta_R_jj']**2 - df[df['is_signal'] == 0]['delta_phi_jj']**2), alpha=0.4, label=r'$\rm background$')
plt.hist(np.sqrt(df[df['is_signal'] == 1]['delta_R_jj']**2 - df[df['is_signal'] == 1]['delta_phi_jj']**2), alpha=0.4, label=r'$\rm signal$')
plt.xlabel(r'$|\Delta\eta_{jj}|$')
plt.ylabel(r'$\rm Number\, of\, events$')
plt.legend()

plt.tight_layout(True)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2622225554889022, 'fraction_numerical': 0.05676364727054589, 'mean_word_length': 7.048883524441762, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '644711', 'license': 'MIT', 'n_tokens_mistral': 6338, 'n_tokens_neox': 5691, 'n_words': 915, 'path': 'notebooks/feature_plots.ipynb', 'repo_name': 'christopher-w-murphy/LHC-Olympics-2020', 'size': '13336'}