Dec-07-2019, 06:35 AM
Hi everyone,
I am trying to test a support vector machine classifier on text data for a kernel I found. I found a kernel that uses a neural network on the data just fine but I cannot use a SVC. The link to the kernel is below:
https://www.kaggle.com/yufengdev/bbc-tex...gorization
The code for my SVC is
ValueError: bad input shape (1424, 5)
Does anyone know why I am getting this error and how I can resolve this problem?
Thanks
I am trying to test a support vector machine classifier on text data for a kernel I found. I found a kernel that uses a neural network on the data just fine but I cannot use a SVC. The link to the kernel is below:
https://www.kaggle.com/yufengdev/bbc-tex...gorization
The code for my SVC is
from sklearn.svm import SVC from sklearn.model_selection import KFold from sklearn.model_selection import cross_val_score k_fold = KFold(n_splits=5, shuffle=True, random_state=0) clf = SVC() scoring = 'accuracy' score = cross_val_score(clf, x_train, y_train, cv=k_fold, n_jobs=1, scoring=scoring) print(score)The error I get is:
ValueError: bad input shape (1424, 5)
Does anyone know why I am getting this error and how I can resolve this problem?
Thanks