onlyzdd / ecg-diagnosis

Deep learning for 12-lead ECG interpretation
125 stars 35 forks source link

执行baseline.py时出现下述问题 #4

Open xiexy-1994 opened 3 years ago

xiexy-1994 commented 3 years ago

执行baseline.py时出现下述问题,不知楼主可否解答一下。

环境按照readme里面的重新配置的

File "baselines.py", line 53, in df_X = generate_features_csv(features_csv, data_dir, patient_ids) File "baselines.py", line 35, in generate_features_csv ecg_features.append(extract_features(ecg_data)) File "/pdpd_workspace/workspace/test/ecg-diagnosis-master/expert_features.py", line 62, in extract_features all_features += extract_channel_features(channel) File "/pdpd_workspace/workspace/test/ecg-diagnosis-master/expert_features.py", line 54, in extract_channel_features return stats_features + wavelet_features + hos_features ValueError: operands could not be broadcast together with shapes (7,) (938,)

way-sal commented 3 years ago

the same error :(

onlyzdd commented 3 years ago

Sorry for the late reply. The problem is unexpected introduced in the last commit. I've reverted it, and it should work now.

way-sal commented 3 years ago

Please, how can I get train.csv and test.csv. In your code you used them indirectly

onlyzdd commented 2 years ago

@way-sal Sorry for the late reply. Do you mean how to get train_ids or test_ids? After running preprocess.py, you'll get the labels.csv. Each row in labels.csv contains a patient's id and the corresponding fold (last column, value ranges 1-10). In the split_data function inside utils.py, the 10 folds are permuted to allow randomness. So in order to get train/val/test.csv, you just need a simple script to import split_data from utils.py and then match it with labels.csv. This should be an easy work using pandas.