<jupyter_start><jupyter_text>Explore labelStefan/<NAME>Since Sat. Oct. 2nd, 2021Match labels typically stored in spreadsheets, to the ECG signals in the PVC dataset. Setup<jupyter_code>import numpy as np
import pandas as pd
import os
from icecream import ic

from ecg_data import EcgData
from ecg_label import EcgLabel

os.chdir('../../PVC_DATA')
dg = EcgData()<jupyter_output><empty_output><jupyter_text>Data for Dae and Weiqing.csvSeems to contain 156 VTs, which aligns with the 156 4,200-dim VT signals in 'MM_classifier/vtdata.mat'. Setup<jupyter_code>dnm = 'daeVt'
dset = dg(dnm)
labels = EcgLabel(dnm)<jupyter_output><empty_output><jupyter_text>Check if the ordering are the same<jupyter_code>cnms_d = dset['case_name']
ic(cnms_d[:10])

pat_num = labels['pat_num'].to_numpy().astype(np.str_)
vt_name = labels['vt_name'].to_numpy()
cnms_l = np.char.add(np.char.add(pat_num, '_'), vt_name)

np.testing.assert_equal(cnms_d, cnms_l)<jupyter_output>ic| cnms_d[:10]: array(['42_VT1', '42_VT2', '42_VT3', '42_VT4', '42_VT5', '42_VT6',
                        '42_VT7', '42_VT8', '45_VT1', '45_VT2'], dtype='<U10')
{'fraction_non_alphanumeric': 0.1393884892086331, 'fraction_numerical': 0.045863309352517985, 'mean_word_length': 5.95625, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 13, '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': '164367', 'license': 'MIT', 'n_tokens_mistral': 487, 'n_tokens_neox': 451, 'n_words': 97, 'path': 'Data-Processing/explore_label.ipynb', 'repo_name': 'StefanHeng/ECG-PVC-Classifier', 'size': '1117'}