yitingliii
commited on
Update svm.py
Browse files
svm.py
CHANGED
@@ -1,5 +1,13 @@
|
|
1 |
|
2 |
from sklearn.svm import SVC
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
svm_model = SVC(kernel='linear', random_state=42)
|
4 |
svm_model.fit(X_train_tfidf, y_train)
|
5 |
y_pred = svm_model.predict(X_test_tfidf)
|
|
|
1 |
|
2 |
from sklearn.svm import SVC
|
3 |
+
import joblib
|
4 |
+
from sklearn.metrics import accuracy_score, classification_report
|
5 |
+
|
6 |
+
X_train_tfidf = joblib.load('X_train_tfidf.pkl')
|
7 |
+
X_test_tfidf = joblib.load('X_test_tfidf.pkl')
|
8 |
+
y_train = joblib.load('y_train.pkl')
|
9 |
+
y_test = joblib.load('y_test.pkl')
|
10 |
+
|
11 |
svm_model = SVC(kernel='linear', random_state=42)
|
12 |
svm_model.fit(X_train_tfidf, y_train)
|
13 |
y_pred = svm_model.predict(X_test_tfidf)
|