diff --git a/svm/svm_author_id.py b/svm/svm_author_id.py index 35390d60ad6..4c47233ac40 100644 --- a/svm/svm_author_id.py +++ b/svm/svm_author_id.py @@ -22,7 +22,16 @@ ######################################################### ### your code goes here ### +from sklearn.svm import SVC +clf = SVC(kernel='linear') +clf.fit(features_train, labels_train) + +predict_test = clf.predict(features_test) + +accuracy = sum(predict_test == labels_test) / len(labels_test) + +print("Accruacy = ", accuracy) #########################################################