yitingliii
commited on
Commit
•
426a192
1
Parent(s):
bb0d5b0
Push model using huggingface_hub.
Browse files- README.md +8 -22
- config.json +4 -0
- model.pkl +3 -0
README.md
CHANGED
@@ -1,22 +1,8 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
from sklearn.feature_extraction.text import TfidfVectorizer
|
10 |
-
tfidf = TfidfVectorizer(max_features=5000, ngram_range=(1, 2), stop_words='english')
|
11 |
-
X_train_tfidf = tfidf.fit_transform(X_train)
|
12 |
-
X_test_tfidf = tfidf.transform(X_test)
|
13 |
-
|
14 |
-
|
15 |
-
from sklearn.svm import SVC
|
16 |
-
svm_model = SVC(kernel='linear', random_state=42)
|
17 |
-
svm_model.fit(X_train_tfidf, y_train)
|
18 |
-
y_pred = svm_model.predict(X_test_tfidf)
|
19 |
-
accuracy = accuracy_score(y_test, y_pred)
|
20 |
-
print(f"Random Forest Accuracy: {accuracy:.4f}")
|
21 |
-
print(classification_report(y_test, y_pred))
|
22 |
-
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- model_hub_mixin
|
4 |
+
---
|
5 |
+
|
6 |
+
This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
|
7 |
+
- Library: [More Information Needed]
|
8 |
+
- Docs: [More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"model_name": "SVM",
|
3 |
+
"num_labels": 2
|
4 |
+
}
|
model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0daefdf1f01cdd491ddb99b0fabfad05df1fbc1fc7f4e6513a8ad83c3a2eb9e8
|
3 |
+
size 349
|