Skip to content

Instantly share code, notes, and snippets.

@jetnew
Created June 1, 2019 18:33
Show Gist options
  • Save jetnew/2b30ba47b237f0446dde3efef23b70a4 to your computer and use it in GitHub Desktop.
Save jetnew/2b30ba47b237f0446dde3efef23b70a4 to your computer and use it in GitHub Desktop.
SVM using scikit-learn
from sklearn.svm import SVC
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, shuffle=True)
clf = SVC(gamma='auto')
clf.fit(X_train, y_train)
y_pred = clf.predict(X_test)
print(classification_report(y_test, y_pred))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment