Where can I find python code for SVM that use multiple feature data?

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?

Topic image-classification svm libsvm

Category Data Science


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

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.