ecg-classification icon indicating copy to clipboard operation
ecg-classification copied to clipboard

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

Open sohan-ranjan opened this issue 4 years ago • 9 comments

While running the run_train_SVM.py, the feature values do get computed, but not sure if they are getting added . train_SVM.py in main(multi_mode, winL, winR, 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) 195 # scaled: zero mean unit variance ( z-score ) 196 scaler = StandardScaler() --> 197 scaler.fit(tr_features) 198 tr_features_scaled = scaler.transform(tr_features)

sohan-ranjan avatar Nov 27 '19 04:11 sohan-ranjan

I am having the same error , How to solve this issue? please help

NasimSulaiman avatar Dec 12 '19 07:12 NasimSulaiman

same issue for me, anyone solved it ?

guidogagl avatar Dec 12 '19 17:12 guidogagl

I made changes and it's running for me now. Could have been the python 2.7 vs. python 3.7 issue. I don't recollect what all I had changed. It had many hard-coded paths too.

On Thu, Dec 12, 2019 at 11:16 PM guidogagl [email protected] wrote:

same issue for me, anyone solved it ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mondejar/ecg-classification/issues/13?email_source=notifications&email_token=ACX7WT52ML3LWQ7WTV7FCZTQYJ2I5A5CNFSM4JSBAN22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGXO2DA#issuecomment-565112076, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACX7WTYQGEUBSTHF5AFCPMDQYJ2I5ANCNFSM4JSBAN2Q .

sohan-ranjan avatar Dec 13 '19 02:12 sohan-ranjan

In which python version did you run the code?

NasimSulaiman avatar Dec 13 '19 05:12 NasimSulaiman

python 3.5 I suppose.

On Fri, Dec 13, 2019 at 10:35 AM NasimSulaiman [email protected] wrote:

In which python version did you run the code?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mondejar/ecg-classification/issues/13?email_source=notifications&email_token=ACX7WT5OPOVC5OARD3DDNC3QYMJZRA5CNFSM4JSBAN22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGY5FWI#issuecomment-565301977, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACX7WT4ZXJB4OXZYIM5JQJDQYMJZRANCNFSM4JSBAN2Q .

sohan-ranjan avatar Dec 13 '19 05:12 sohan-ranjan

I am using python 3.8 and this is the error i am getting File "C:\Program Files\Python36\lib\site-packages\sklearn\utils\validation.py", line 570, in check_array context)) ValueError: Found array with 0 sample(s) (shape=(0, 59)) while a minimum of 1 is required by StandardScaler.

NasimSulaiman avatar Dec 13 '19 05:12 NasimSulaiman

(a, b) denotes the shape of data where a is number of rows and, b is the number of columns. (0,59) means there's no data being read.

Kindly check the lines where data is being read in LOAD_MITBIH.py and debug. You can might need to change the way it has been done. Finally delete all pickle files and run codes again.

banivyom avatar Mar 20 '20 16:03 banivyom

I am having the same error , How to solve this issue? please help

sameherajili avatar Jul 03 '22 22:07 sameherajili

This error means that your dataset is not loaded. You should check db_path variable from train_SVM.py, and update wherever you have downloaded the dataset.

mondejar avatar Jul 20 '22 06:07 mondejar