yitingliii commited on
Commit
426a192
1 Parent(s): bb0d5b0

Push model using huggingface_hub.

Browse files
Files changed (3) hide show
  1. README.md +8 -22
  2. config.json +4 -0
  3. model.pkl +3 -0
README.md CHANGED
@@ -1,22 +1,8 @@
1
- # Assuming training and testing data are using the same names as we did in the skeleton code provided by the TA
2
-
3
- X_train = dataset_train['title']
4
- y_train = dataset_train['labels']
5
-
6
- X_test = dataset_test['title']
7
- y_test = dataset_test['labels']
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