#Import Library
from sklearn import svm
import numpy as np
X=np.array([
[[25,25,25],[0,0,0],[0,0,0]],
[[25,0,0],[25,0,0],[25,0,0]],
[[75,75,75],[75,75,75],[75,75,75]]
])
y=np.array([-1,1,1]
)
C=10
model = svm.SVC(kernel='rbf', C=10, gamma=0.6)
model.fit(X, y)
model.score(X, y)
when I tried to run this code , I got this error
ValueError: Found array with dim 3. Estimator expected <= 2.
I would like that you help me solve this error. I want to train the svm to classify image pixels into two classes (edge and non-edges ), any suggestions will be helpful thanks in advance
X=np.array([...])byX=np.array(...)should be good.