-2
$\begingroup$

I am trying do an Image Classification where each sample of training data contains data of the current pixel with the 8 surrounding ones.

Where can I find examples of SVM, in python, that use 5 or more features in training?

$\endgroup$
1
$\begingroup$

By modifying the $2$-dimensional example in scikit Documentation about SVM, we have this $5$ dimensional example.

from sklearn import svm
X = [[0, 0, 0, 0, 0], [1, 1, 1, 1, 1]]
y = [0, 1]
clf = svm.SVC()
clf.fit(X, y)  
print(clf.predict([[2., 2., 2., 2., 2.], [-1 for i in range(5)]]))

You can read more about the parameters option of SVC here

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.