<jupyter_start><jupyter_text>General Population<jupyter_code>from imblearn.over_sampling import SMOTE
sm = SMOTE(random_state = 42)
co_train_gpop_sm,out_train_death_gpop_sm = sm.fit_resample(co_train_gpop,out_train_death_gpop)

best_clf = rf(co_train_gpop_sm, out_train_death_gpop_sm, co_train_gpop_split, out_train_death_gpop_split)

cross_val(co_train_gpop_sm, out_train_death_gpop_sm,  co_train_gpop_split, out_train_death_gpop_split, co_validation_gpop_split, out_validation_death_gpop_split)

print("", file = open('death_smote_rf_ehr.out', 'a'))

scores(co_train_gpop, out_train_death_gpop)

print("", file = open('death_smote_rf_ehr.out', 'a'))

scores(co_validation_gpop, out_validation_death_gpop)<jupyter_output>80
80
80
80
80
0.8893889324701829
0.6770478542826818
0.679215999764904
0.8503675967098921
0.33694013441227266
0.8893578721951523
0.42229784475773785
0.6827809480355258
0.8546398605939809
0.33530831379605736
0.8595432788193059
0.3348288075560803
0.6295419072689676
0.7758331652621274
0.3868569267816262<jupyter_text>Low Continuity<jupyter_code>from imblearn.over_sampling import SMOTE
sm = SMOTE(random_state = 42)
co_train_low_sm,out_train_death_low_sm = sm.fit_resample(co_train_low,out_train_death_low)

best_clf = rf(co_train_low_sm, out_train_death_low_sm, co_train_low_split, out_train_death_low_split)

cross_val(co_train_low_sm, out_train_death_low_sm,  co_train_low_split, out_train_death_low_split, co_validation_low_split, out_validation_death_low_split)

print("")

scores(co_train_low, out_train_death_low)

print("")

scores(co_validation_low, out_validation_death_low)<jupyter_output>80
80
80
80
80
80
0.8788922310442662
0.7159318078897738
0.7174208143284251
0.8464767492943082
0.3896562520095445

0.8813482564533868
0.5145579671784014
0.7251557565926356
0.8538559462808759
0.3849730297110515

0.8359419736590953
0.3800937612693833
0.6416181191577753
0.7532005824597963
0.44844373828265377<jupyter_text>High Continuity<jupyter_code>from imblearn.over_sampling import SMOTE
sm = SMOTE(random_state = 42)
co_train_high_sm,out_train_death_high_sm = sm.fit_resample(co_train_high,out_train_death_high)

best_clf = rf(co_train_high_sm, out_train_death_high_sm, co_train_high_split, out_train_death_high_split)

cross_val(co_train_high_sm, out_train_death_high_sm,  co_train_high_split, out_train_death_high_split, co_validation_high_split, out_validation_death_high_split)

print("")

scores(co_train_high, out_train_death_high)

print("")

scores(co_validation_high, out_validation_death_high)<jupyter_output>80
80
80
80
80
80
0.9447639950544768
0.698508836420766
0.6617079727669768
0.9176133737047623
0.227397168811344

0.9458959675495109
0.42776025236593057
0.6604126195167681
0.9223661508809289
0.22333337943472267

0.9244101064940489
0.16972477064220184
0.5520210142762721
0.8127545745925457
0.26688233284756974
{'fraction_non_alphanumeric': 0.06989813839128908, 'fraction_numerical': 0.2845100105374078, 'mean_word_length': 11.067796610169491, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '500012', 'license': 'MIT', 'n_tokens_mistral': 1755, 'n_tokens_neox': 1270, 'n_words': 144, 'path': 'EHR_Only/RF/Death_SMOTE_Custom_GridSearch.ipynb', 'repo_name': 'shreyaskar123/EHR-Discontinuity', 'size': '2847'}