|
194 | 194 | },
|
195 | 195 | "outputs": [],
|
196 | 196 | "source": [
|
197 |
| - "# Comment this out and uncomment the next section to load the project\n", |
198 |
| - "project = client.create_project(\n", |
| 197 | + "project = client.create_or_load_project(\n", |
199 | 198 | " name=\"Sklearn Banking Project\",\n",
|
200 | 199 | " description=\"Project to Demo Sklearn with Unbox\",\n",
|
201 | 200 | " task_type=TaskType.TextClassification,\n",
|
202 |
| - ")\n", |
203 |
| - "\n", |
204 |
| - "# Use this for loading the project on subsequent runs\n", |
205 |
| - "'''\n", |
206 |
| - "project = client.load_project(\n", |
207 |
| - " name=\"Sklearn Banking Project\"\n", |
208 |
| - ")\n", |
209 |
| - "'''\n", |
210 |
| - "\n", |
211 |
| - "unbox_model = project.add_model(\n", |
212 |
| - " function=predict_function, \n", |
213 |
| - " model=model,\n", |
214 |
| - " model_type=ModelType.sklearn,\n", |
215 |
| - " class_names=label_list,\n", |
216 |
| - " name='Banking Model',\n", |
217 |
| - " description='this is my sklearn banking model'\n", |
218 |
| - ")\n", |
219 |
| - "unbox_model.to_dict()" |
| 201 | + ")" |
220 | 202 | ]
|
221 | 203 | },
|
222 | 204 | {
|
|
231 | 213 | " class_names=label_list,\n",
|
232 | 214 | " label_column_name=\"label_code\",\n",
|
233 | 215 | " text_column_name=\"text\",\n",
|
234 |
| - " task_type=TaskType.TextClassification,\n", |
235 |
| - " name=\"Banking Test Dataset\",\n", |
236 |
| - " description=\"my banking validation dataset\"\n", |
| 216 | + " commit_message=\"first version\"\n", |
237 | 217 | ")\n",
|
238 | 218 | "dataset.to_dict()"
|
239 | 219 | ]
|
| 220 | + }, |
| 221 | + { |
| 222 | + "cell_type": "code", |
| 223 | + "execution_count": null, |
| 224 | + "id": "e23831c4", |
| 225 | + "metadata": {}, |
| 226 | + "outputs": [], |
| 227 | + "source": [ |
| 228 | + "unbox_model = project.add_model(\n", |
| 229 | + " function=predict_function, \n", |
| 230 | + " model=model,\n", |
| 231 | + " model_type=ModelType.sklearn,\n", |
| 232 | + " class_names=label_list,\n", |
| 233 | + " name='Banking Model',\n", |
| 234 | + " commit_message='first version'\n", |
| 235 | + ")\n", |
| 236 | + "unbox_model.to_dict()" |
| 237 | + ] |
240 | 238 | }
|
241 | 239 | ],
|
242 | 240 | "metadata": {
|
|
255 | 253 | "name": "python",
|
256 | 254 | "nbconvert_exporter": "python",
|
257 | 255 | "pygments_lexer": "ipython3",
|
258 |
| - "version": "3.8.12" |
| 256 | + "version": "3.8.10" |
259 | 257 | }
|
260 | 258 | },
|
261 | 259 | "nbformat": 4,
|
|
0 commit comments