Rushi
commited on
Commit
·
9f74ae0
1
Parent(s):
7722ca3
Upload main.py
Browse files
main.py
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from sklearn.metrics import (
|
2 |
+
|
3 |
+
ConfusionMatrixDisplay,
|
4 |
+
|
5 |
+
confusion_matrix,
|
6 |
+
|
7 |
+
accuracy_score,
|
8 |
+
|
9 |
+
f1_score
|
10 |
+
|
11 |
+
)
|
12 |
+
|
13 |
+
import tempfile
|
14 |
+
|
15 |
+
from pathlib import Path
|
16 |
+
|
17 |
+
from sklearn.datasets import load_iris
|
18 |
+
|
19 |
+
from sklearn.linear_model import LogisticRegression
|
20 |
+
|
21 |
+
from skops import card
|
22 |
+
from skops import hub_utils
|
23 |
+
# hub_utils.download(repo_id="scikit-learn/tabular-playground", dst = "./dst")
|
24 |
+
|
25 |
+
|
26 |
+
import pickle
|
27 |
+
model = pickle.load(open("./dst/model.pkl", "rb"))
|
28 |
+
|
29 |
+
# model = LogisticRegression(solver="liblinear", random_state=0).fit(X, y)
|
30 |
+
|
31 |
+
model_card = card.Card(model)
|
32 |
+
|
33 |
+
model_card.metadata.license = "mit"
|
34 |
+
|
35 |
+
model_card.add(
|
36 |
+
citation_bibtex="""
|
37 |
+
|
38 |
+
# h1
|
39 |
+
tjos osmda
|
40 |
+
|
41 |
+
""",
|
42 |
+
trainingprocedure="123",
|
43 |
+
)
|
44 |
+
|
45 |
+
|
46 |
+
model_card.save("README.md")
|