From 16a84b86e3cc0ad540fd91c833cc2f2ea8e140e0 Mon Sep 17 00:00:00 2001 From: anmolag190153 <58358607+anmolag190153@users.noreply.github.com> Date: Sun, 21 Jun 2020 19:58:45 +0530 Subject: [PATCH] Update svm_author_id.py --- svm/svm_author_id.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/svm/svm_author_id.py b/svm/svm_author_id.py index fda3f7fdb28..6f352caa681 100644 --- a/svm/svm_author_id.py +++ b/svm/svm_author_id.py @@ -18,7 +18,14 @@ ### and testing datasets, respectively ### labels_train and labels_test are the corresponding item labels features_train, features_test, labels_train, labels_test = preprocess() - +clf=svm.SVC(kernel="linear") +clf.fit(features_train,labels_train) +pred=clf.predict(features_test) +from sklearn.metrics import accuracy_score +acc = accuracy_score(pred, labels_test) + +def submitAccuracy(): + return acc