Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sohan-ranjan opened this issue Nov 27, 2019 · 9 comments

Comments

@sohan-ranjan
Copy link

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)

@NasimSulaiman
Copy link

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

@guidogagl
Copy link

same issue for me, anyone solved it ?

@sohan-ranjan
Copy link
Author

sohan-ranjan commented Dec 13, 2019 via email

@NasimSulaiman
Copy link

In which python version did you run the code?

@sohan-ranjan
Copy link
Author

sohan-ranjan commented Dec 13, 2019 via email

@NasimSulaiman
Copy link

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.

@banivyom
Copy link

(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.

@sameherajili
Copy link

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

@mondejar
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants