Issue
I got an error while running the code below. I've tried every solution I found but they didn't work.
The error is
ValueError: Unknown label type: 'continuous'
and here's my code:
random_state=0
classifier = SVC(kernel='linear', random_state = 0)
classifier.fit(X_train, y_train)
I got this error on:
classifier.fit(X_train, y_train)
The state
is the dependent variable and k
is the independent variable. So I would like to train these. My main purpose is to estimate the state information according to the new k
variable. I'm not using an index for the training. X
and Y
sets are equal to 'k' and 'state'.
Solution
It is very hard to say why you are getting this error without looking at the data.
However, my first guess is that you must be passing non integer value as label, in heading of state it says 0/1 but I am not sure if that's the case.
I'd suggest you 2 options.
- Explicitly convert the datatype to
int32
usingastype()
function. - Use
LabelEncoder
to encode your output variable.
Answered By - Gaurav Singhal
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.