Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{
"cells": [
{
"cell_type": "markdown",
"id": "cac88086-1bc3-4916-809f-85e7e94f8fe0",
"metadata": {},
"source": [
"## Renku MLS Plug-in demo"
]
},
{
"cell_type": "markdown",
"id": "2b928da5-636d-463c-a081-98586cf8c468",
"metadata": {},
"source": [
"This plug-in allows you to compare across different `renku run` iterations in terms of pre-defined metrics."
]
},
{
"cell_type": "markdown",
"id": "a13b4e8a-660f-402a-8e53-72b68b198985",
"metadata": {},
"source": [
"See `src/train.py` for the demonstration training file."
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "4b06791b-a3c2-45db-a788-69c8c39d0cf0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"You chose the RandomForestClassifier model.\n",
"Accuracy: 1.0\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/opt/conda/lib/python3.9/site-packages/xgboost/compat.py:36: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.\n",
" from pandas import MultiIndex, Int64Index\n"
]
}
],
"source": [
"%%bash\n",
"cd ../ # Return to the main repository\n",
"python src/train.py data/wine/wine.data label RandomForestClassifier models/RFC"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "c6544915-fda6-4728-92a4-faa27acb2be0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"You chose the LinearSVC model.\n",
"Accuracy: 0.9152542372881356\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/opt/conda/lib/python3.9/site-packages/xgboost/compat.py:36: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.\n",
" from pandas import MultiIndex, Int64Index\n",
"/opt/conda/lib/python3.9/site-packages/sklearn/svm/_base.py:1206: ConvergenceWarning: Liblinear failed to converge, increase the number of iterations.\n",
" warnings.warn(\n"
]
}
],
"source": [
"%%bash\n",
"cd ../ # Return to the main repository\n",
"python src/train.py data/wine/wine.data label LinearSVC models/SVC"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "7d2b84bb-0c7d-4095-8af5-83ff05e50c4f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"You chose the XGBClassifier model.\n",
"[01:12:17] WARNING: ../src/learner.cc:1115: Starting in XGBoost 1.3.0, the default evaluation metric used with the objective 'multi:softprob' was changed from 'merror' to 'mlogloss'. Explicitly set eval_metric if you'd like to restore the old behavior.\n",
"Accuracy: 0.9830508474576272\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/opt/conda/lib/python3.9/site-packages/xgboost/compat.py:36: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.\n",
" from pandas import MultiIndex, Int64Index\n",
"/opt/conda/lib/python3.9/site-packages/xgboost/sklearn.py:1224: UserWarning: The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].\n",
" warnings.warn(label_encoder_deprecation_msg, UserWarning)\n"
]
}
],
"source": [
"%%bash\n",
"cd ../ # Return to the main repository\n",
"python src/train.py data/wine/wine.data label XGBClassifier models/XGB"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}