<jupyter_start><jupyter_text>Sample 80/20 splits across all patients and combine them all together<jupyter_code>splits = [get_partition(num,return_bool_mask=True) for num in pt_samples]
train_bools = [s[0] for s in splits]
test_bools = [s[1] for s in splits]
train_idxs = np.concatenate(train_bools,axis=0)
test_idxs = np.concatenate(test_bools,axis=0)
train_idxs.astype(np.int).sum()
mod_params = dict(
    layer_spec=[32],
    activ='relu',
    optim='nadam',
    num_labels=3
)
mod = feedforward(**mod_params)
mod.summary()
X = scaled_X[train_idxs]
Y = oh_Y[train_idxs]
Y_w = ex_weight[train_idxs]
mod.fit(X,Y,
        batch_size=128,
        epochs=300,
        sample_weight=Y_w,
        verbose=0)
X_test = scaled_X[test_idxs]
Y_test = oh_Y[test_idxs]
print(mod.evaluate(X_test,Y_test))
acc = [mod.evaluate(scaled_X[m][test_idxs],oh_Y[m][test_idxs]) for m,test_idxs in zip(pt_masks,test_bools)]
acc
plt.scatter(np.zeros(9),np.array(acc)[:,1])
plt.ylim(0.3333,1)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1424272818455366, 'fraction_numerical': 0.026078234704112337, 'mean_word_length': 5.930555555555555, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '642780', 'license': 'MIT', 'n_tokens_mistral': 447, 'n_tokens_neox': 424, 'n_words': 67, 'path': 'examples/model_validation.ipynb', 'repo_name': 'neuropil/sleep_ann', 'size': '997'}