Created
June 1, 2019 18:33
-
-
Save jetnew/2b30ba47b237f0446dde3efef23b70a4 to your computer and use it in GitHub Desktop.
SVM using scikit-learn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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