<jupyter_start><jupyter_text>Congestive Heart Failure: pre-processing & embedding generation<jupyter_code>chf = CHFDataset()
chf.set_dataset("/content/drive/Shared drives/Anthem Project/Data/synthea-data-general.tar.gz", sample_size=1000)
chf.emb.generate_onehot(label="chf", window_range=24, predict_range=1)
chf.emb.generate_wordemb(label="chf", window_range=24, predict_range=1)
display(chf.emb.onehot[1])
display(chf.emb.wordemb[1])
sum_codes(chf.emb.onehot, 'chf')<jupyter_output>0 labels: 710 
1 labels: 129<jupyter_text>Myocardial Infarction: pre-processing & embedding generation<jupyter_code>myoinf = MYOINFDataset()
myoinf.set_dataset("/content/drive/Shared drives/Anthem Project/Data/synthea-data-general.tar.gz", sample_size=1000)
myoinf.emb.generate_onehot(label="myoinf", window_range=24, predict_range=1)
myoinf.emb.generate_wordemb(label="myoinf", window_range=24, predict_range=1)<jupyter_output><empty_output><jupyter_text>Export embeddings and compress<jupyter_code>OSUtil.export_csv("csv-chf-onehot", chf.emb.onehot)
OSUtil.export_npy("csv-chf-wordemb", chf.emb.wordemb)

OSUtil.export_csv("csv-myoinf-onehot", myoinf.emb.onehot)
OSUtil.export_npy("csv-myoinf-wordemb", myoinf.emb.wordemb)
OSUtil.zip_folder('csv-chf-onehot', 'csv-chf-onehot')
OSUtil.zip_folder('csv-chf-wordemb', 'csv-chf-wordemb')

OSUtil.zip_folder('csv-myoinf-onehot', 'csv-myoinf-onehot')
OSUtil.zip_folder('csv-myoinf-wordemb', 'csv-myoinf-wordemb')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1514945652173913, 'fraction_numerical': 0.020380434782608696, 'mean_word_length': 9.229166666666666, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '46058', 'license': 'MIT', 'n_tokens_mistral': 610, 'n_tokens_neox': 585, 'n_words': 59, 'path': 'Data Preprocessing and Tranformation/synthea_data_pipeline.ipynb', 'repo_name': 'anthem-ai/ucsc-engineering-2020', 'size': '1472'}