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?
Data Science Stack Exchange is a question and answer site for Data science professionals, Machine Learning specialists, and those interested in learning more about the field. It only takes a minute to sign up.
Sign up to join this communityI 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?
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