mondejar / ecg-classification

Code for training and test machine learning classifiers on MIT-BIH Arrhyhtmia database
GNU General Public License v3.0
528 stars 193 forks source link

Error While creating mitbihfeatures pickle file #4

Closed banivyom closed 6 years ago

banivyom commented 6 years ago

Morph used: u-lbp Error: Found array with 0 sample(s) (shape=(0, 59)) while a minimum of 1 is required by StandardScaler. Morph used: wvlt Error: Found array with 0 sample(s) (shape=(0, 23)) while a minimum of 1 is required by StandardScaler.

banivyom commented 6 years ago

Runing train_SVM.py! Loading MIT BIH arr (DS1) ... Computing RR intervals ... /usr/lib/python3/dist-packages/numpy/lib/function_base.py:1110: RuntimeWarning: Mean of empty slice. avg = a.mean(axis) /usr/lib/python3/dist-packages/numpy/core/_methods.py:80: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) Computing morphological features (DS1) ... u-lbp ... (0, 59) Wavelets ... labels writing pickle: mitbihfeatures/w_90_90_DS1_rm_bsline_maxRR_RR_norm_RR_u-lbp_wvlt_reduced_MLII.p... Loading MIT BIH arr (DS2) ... Computing RR intervals ... Computing morphological features (DS2) ... u-lbp ... (0, 59) Wavelets ... labels writing pickle: mitbihfeatures/w_90_90_DS2_rm_bsline_maxRR_RR_norm_RR_u-lbp_wvlt_reduced_MLII.p... Traceback (most recent call last):

File "", line 52, in main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)

File "/home/vyom/Downloads/ecg-classification-master/python/train_SVM.py", line 196, in main scaler.fit(tr_features)

File "/usr/local/lib/python3.6/dist-packages/sklearn/preprocessing/data.py", line 590, in fit return self.partial_fit(X, y)

File "/usr/local/lib/python3.6/dist-packages/sklearn/preprocessing/data.py", line 612, in partial_fit warn_on_dtype=True, estimator=self, dtype=FLOAT_DTYPES)

File "/usr/local/lib/python3.6/dist-packages/sklearn/utils/validation.py", line 462, in check_array context))

ValueError: Found array with 0 sample(s) (shape=(0, 23)) while a minimum of 1 is required by StandardScaler.

gemorningsun commented 5 years ago

hello~ How to solve this problem? Thanks.

RayShark commented 5 years ago

Hi, @banivyom , can you give some simple solution tips?