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

Error: y contains previously unseen labels: [4] #38

Closed
MaameBoamahPoku opened this issue Dec 22, 2021 · 2 comments
Closed

Error: y contains previously unseen labels: [4] #38

MaameBoamahPoku opened this issue Dec 22, 2021 · 2 comments

Comments

@MaameBoamahPoku
Copy link

Hi @thieu1995
I am attempting to implement a GWO optimized SVM and I run into an error
"y contains previously unseen labels: [4]" as seen in the third image

However, when the standalone SVM codes run with any error. I have attached snips of both codes to this issue.
SVM
GWO_SVM

Error

@thieu1995
Copy link
Owner

@MaameBoamahPoku
Make sure you set a good lower bound and upper bound. The shown error is too obvious that you are missing a value in KERNEL_ENCODER. It should be:

KERNEL_ENCODER = LabelEncoder()
KERNEL_ENCODER.fit( ['linear', 'poly', 'rbf', 'sigmoid', 'precomputed'] )  
# domain range ==> 5 values, index start from 0 ==> (lb, ub) = (0, 4.99)

@MaameBoamahPoku
Copy link
Author

Okay, thank you. I checked my lb and ub and my codes are running now:)

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

2 participants