<jupyter_start><jupyter_text>Just kappa_u and kappa_d<jupyter_code>df_ku['class'] = 1
df_ku_test['class'] = 1
df_kd['class'] = 0
df_kd_test['class'] = 0

channels = [df_ku, df_kd]
df_train = pd.concat(channels, ignore_index=True)
df_train = df_train.sample(frac=1).reset_index(drop=True)

names_orig = names
class_names = [r'$d \bar d hh$', r'$u \bar u hh$']
filename = '../results/models/HL-LHC-BDT/hh-BDT-2class-ku-kd.pickle.dat'
shap_plot = '../plots/HL-LHC-shap-ku-kd.pdf'

classifier, x_test, y_test, shap_values_2ud, X_shap_2ud = runBDT(df_train, filename, depth=10)
abs_shap(shap_values_2ud, X_shap_2ud, shap_plot, names=names, class_names=class_names, cmp=cmp_5)
ku_p = df_ku_test.sample(n=round(weight_ku), replace=True, random_state=seed).reset_index(drop=True)
kd_p = df_kd_test.sample(n=round(weight_kd), replace=True, random_state=seed).reset_index(drop=True)

print('Accuracy Score for ku: {:4.2f}% '.format(100*metrics.accuracy_score(ku_p['class'].values, classifier.predict(ku_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for kd: {:4.2f}% '.format(100*metrics.accuracy_score(kd_p['class'].values, classifier.predict(kd_p.drop(columns=['class', 'weight']).values))))
df_array = [df_kd_test, df_ku_test]
weight_array = [weight_kd, weight_ku]
keys = ['ku', 'kd']
filename = '../results/confusion/HL-LHC-BDT/hh-BDT-2class-ku-kd.confusion.json'

df = build_confusion(df_array, weight_array, classifier, filename, keys)
df<jupyter_output><empty_output><jupyter_text>hh and kappa_u, kappa_d<jupyter_code>df_ku['class'] = 2
df_ku_test['class'] = 2
df_kd['class'] = 1
df_kd_test['class'] = 1
df_hhsm['class'] = 0
df_hhsm_test['class'] = 0

channels = [df_ku, df_kd, df_hhsm]
df_train = pd.concat(channels, ignore_index=True)
df_train = df_train.sample(frac=1).reset_index(drop=True)

names_orig = names
class_names = [r'$hh^{gg\rm F}$', r'$d \bar d hh$', r'$u \bar u hh$']
filename = '../results/models/HL-LHC-BDT/hh-BDT-2class-ku-kd-hhsm.pickle.dat'
shap_plot = '../plots/HL-LHC-shap-ku-kd-hhsm.pdf'

classifier, x_test, y_test, shap_values_3ud, X_shap_3ud = runBDT(df_train, filename, depth=10)
abs_shap(shap_values_3ud, X_shap_3ud, shap_plot, names=names, class_names=class_names, cmp=cmp_3)
ku_p = df_ku_test.sample(n=round(weight_ku), replace=True, random_state=seed).reset_index(drop=True)
kd_p = df_kd_test.sample(n=round(weight_kd), replace=True, random_state=seed).reset_index(drop=True)
hhsm_p = df_hhsm_test.sample(n=round(weight_hhsm), replace=True, random_state=seed).reset_index(drop=True)

print('Accuracy Score for ku: {:4.2f}% '.format(100*metrics.accuracy_score(ku_p['class'].values, classifier.predict(ku_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for kd: {:4.2f}% '.format(100*metrics.accuracy_score(kd_p['class'].values, classifier.predict(kd_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for hhsm: {:4.2f}% '.format(100*metrics.accuracy_score(hhsm_p['class'].values, classifier.predict(hhsm_p.drop(columns=['class', 'weight']).values))))
df_array = [df_kd_test, df_ku_test, df_hhsm_test]
weight_array = [weight_kd, weight_ku, weight_hhsm]
keys = ['<KEY>']
filename = '../results/confusion/HL-LHC-BDT/hh-BDT-2class-ku-kd-hhsm.confusion.json'

df = build_confusion(df_array, weight_array, classifier, filename, keys)
df<jupyter_output><empty_output><jupyter_text>_________________________________ kappa_u<jupyter_code>df_ku['class'] = 3
df_ku_test['class'] = 3
df_hhsm['class'] = 2
df_hhsm_test['class'] = 2

channels = [df_ku, df_hhsm, df_bbh_tth, df_bbxaa]
df_train = pd.concat(channels, ignore_index=True)
df_train = df_train.sample(frac=1).reset_index(drop=True)
class_names = [r'$bb\gamma\gamma$', r'$Q\bar{Q}h$', r'$hh^{gg\rm F}$', r'$u \bar u hh$']
filename = '../results/models/HL-LHC-BDT/hh-BDT-4class-ku.pickle.dat'
shap_plot = '../plots/HL-LHC-shap-bbxaa-bbh-tth-hhsm-ku-only.pdf'

classifier, x_test, y_test, shap_values_4u, X_shap_4u = runBDT(df_train, filename, depth=10)
abs_shap(shap_values_4u, X_shap_4u, shap_plot, names=names, class_names=class_names, cmp=cmp_5)
ku_p = df_ku_test.sample(n=round(weight_ku), replace=True, random_state=seed).reset_index(drop=True)
hhsm_p = df_hhsm_test.sample(n=round(weight_hhsm), replace=True, random_state=seed).reset_index(drop=True)
bbh_tth_p = df_bbh_tth_test.sample(n=round(weight_bbh_tth), replace=True, random_state=seed).reset_index(drop=True)
bbxaa_p = df_bbxaa_test.sample(n=round(weight_bbxaa), replace=True, random_state=seed).reset_index(drop=True)

print('Accuracy Score for ku: {:4.2f}% '.format(100*metrics.accuracy_score(ku_p['class'].values, classifier.predict(ku_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for hhsm: {:4.2f}% '.format(100*metrics.accuracy_score(hhsm_p['class'].values, classifier.predict(hhsm_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for bbh+tth: {:4.2f}% '.format(100*metrics.accuracy_score(bbh_tth_p['class'].values, classifier.predict(bbh_tth_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for bbxaa: {:4.2f}% '.format(100*metrics.accuracy_score(bbxaa_p['class'].values, classifier.predict(bbxaa_p.drop(columns=['class', 'weight']).values))))
df_array = [df_bbxaa_test, df_bbh_tth_test, df_hhsm, df_ku_test]
weight_array = [weight_bbxaa, weight_bbh_tth, weight_hhsm, weight_ku]
keys = ['ku', 'hhsm', 'tth+bbh', 'bbxaa']
filename = '../results/confusion/HL-LHC-BDT/hh-BDT-4class-ku-only.confusion.json'

df = build_confusion(df_array, weight_array, classifier, filename, keys)
df<jupyter_output><empty_output><jupyter_text>_________________________________ kappa_d<jupyter_code>df_kd['class'] = 3
df_kd_test['class'] = 3
df_hhsm['class'] = 2
df_hhsm_test['class'] = 2

channels = [df_kd, df_hhsm, df_bbh_tth, df_bbxaa]
df_train = pd.concat(channels, ignore_index=True)
df_train = df_train.sample(frac=1).reset_index(drop=True)
class_names = [r'$bb\gamma\gamma$', r'$Q\bar{Q}h$', r'$hh^{gg\rm F}$', r'$d \bar d hh$']
filename = '../results/models/HL-LHC-BDT/hh-BDT-4class-kd.pickle.dat'
shap_plot = '../plots/HL-LHC-shap-bbxaa-bbh-tth-hhsm-kd-only.pdf'

classifier, x_test, y_test, shap_values_4d, X_shap_4d = runBDT(df_train, filename, depth=10)
abs_shap(shap_values_4d, X_shap_4d, shap_plot, names=names, class_names=class_names, cmp=cmp_5)
kd_p = df_kd_test.sample(n=round(weight_kd), replace=True, random_state=seed).reset_index(drop=True)
hhsm_p = df_hhsm_test.sample(n=round(weight_hhsm), replace=True, random_state=seed).reset_index(drop=True)
bbh_tth_p = df_bbh_tth_test.sample(n=round(weight_bbh_tth), replace=True, random_state=seed).reset_index(drop=True)
bbxaa_p = df_bbxaa_test.sample(n=round(weight_bbxaa), replace=True, random_state=seed).reset_index(drop=True)

print('Accuracy Score for kd: {:4.2f}% '.format(100*metrics.accuracy_score(kd_p['class'].values, classifier.predict(kd_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for hhsm: {:4.2f}% '.format(100*metrics.accuracy_score(hhsm_p['class'].values, classifier.predict(hhsm_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for bbh+tth: {:4.2f}% '.format(100*metrics.accuracy_score(bbh_tth_p['class'].values, classifier.predict(bbh_tth_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for bbxaa: {:4.2f}% '.format(100*metrics.accuracy_score(bbxaa_p['class'].values, classifier.predict(bbxaa_p.drop(columns=['class', 'weight']).values))))
df_array = [df_bbxaa_test, df_bbh_tth_test, df_hhsm, df_kd_test]
weight_array = [weight_bbxaa, weight_bbh_tth, weight_hhsm, weight_kd]
keys = ['kd', 'hhsm', 'tth+bbh', 'bbxaa']
filename = '../results/confusion/HL-LHC-BDT/hh-BDT-4class-kd-only.confusion.json'

df = build_confusion(df_array, weight_array, classifier, filename, keys)
df<jupyter_output><empty_output><jupyter_text>_________________________________ The kappa_u & kappa_d<jupyter_code>df_ku['class'] = 4
df_ku_test['class'] = 4
df_kd['class'] = 3
df_kd_test['class'] = 3
df_hhsm['class'] = 2
df_hhsm_test['class'] = 2

channels = [df_ku, df_kd, df_hhsm, df_bbh_tth, df_bbxaa]
df_train = pd.concat(channels, ignore_index=True)
df_train = df_train.sample(frac=1).reset_index(drop=True)
class_names = [r'$bb\gamma\gamma$', r'$Q\bar{Q}h$', r'$hh^{gg\rm F}$', r'$d \bar d hh$', r'$u \bar u hh$']
filename = '../results/models/HL-LHC-BDT/hh-BDT-5class-ku-kd.pickle.dat'
shap_plot = '../plots/HL-LHC-shap-bbxaa-bbh-tth-hhsm-ku-kd.pdf'

classifier, x_test, y_test, shap_values_5ud, X_shap_5ud = runBDT(df_train, filename, depth=10)
abs_shap(shap_values_5ud, X_shap_5ud, shap_plot, names=names, class_names=class_names, cmp=cmp_5)
ku_p = df_ku_test.sample(n=round(weight_ku), replace=True, random_state=seed).reset_index(drop=True)
kd_p = df_kd_test.sample(n=round(weight_kd), replace=True, random_state=seed).reset_index(drop=True)
hhsm_p = df_hhsm_test.sample(n=round(weight_hhsm), replace=True, random_state=seed).reset_index(drop=True)
bbh_tth_p = df_bbh_tth_test.sample(n=round(weight_bbh_tth), replace=True, random_state=seed).reset_index(drop=True)
bbxaa_p = df_bbxaa_test.sample(n=round(weight_bbxaa), replace=True, random_state=seed).reset_index(drop=True)

print('Accuracy Score for ku: {:4.2f}% '.format(100*metrics.accuracy_score(ku_p['class'].values, classifier.predict(ku_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for kd: {:4.2f}% '.format(100*metrics.accuracy_score(kd_p['class'].values, classifier.predict(kd_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for hhsm: {:4.2f}% '.format(100*metrics.accuracy_score(hhsm_p['class'].values, classifier.predict(hhsm_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for bbh+tth: {:4.2f}% '.format(100*metrics.accuracy_score(bbh_tth_p['class'].values, classifier.predict(bbh_tth_p.drop(columns=['class', 'weight']).values))))
print('Accuracy Score for bbxaa: {:4.2f}% '.format(100*metrics.accuracy_score(bbxaa_p['class'].values, classifier.predict(bbxaa_p.drop(columns=['class', 'weight']).values))))
df_array = [df_bbxaa_test, df_bbh_tth_test, df_hhsm, df_kd_test, df_ku_test]
weight_array = [weight_bbxaa, weight_bbh_tth, weight_hhsm, weight_kd, weight_ku]
keys = ['ku', 'kd', 'hhsm', 'tth+bbh', 'bbxaa']
filename = '../results/confusion/HL-LHC-BDT/hh-BDT-5class-ku-kd.confusion.json'

df = build_confusion(df_array, weight_array, classifier, filename, keys)
df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17884929401594468, 'fraction_numerical': 0.015752569397752377, 'mean_word_length': 8.474067333939946, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '232156', 'license': 'MIT', 'n_tokens_mistral': 4464, 'n_tokens_neox': 4309, 'n_words': 576, 'path': 'machine_learning/Mega-BDT-ku-kd-HL-LHC.ipynb', 'repo_name': 'talismanbrandi/IML-diHiggs', 'size': '10422'}