|
10 | 10 | "\n", |
11 | 11 | "## **Key Features:**\n", |
12 | 12 | "1. Experiment Tracking\n", |
13 | | - "2. Model Registry" |
| 13 | + "2. Model Registry\n", |
| 14 | + "\n", |
| 15 | + "<img src=\"img/tracking_experiments.PNG\">\n" |
14 | 16 | ] |
15 | 17 | }, |
16 | 18 | { |
|
222 | 224 | }, |
223 | 225 | { |
224 | 226 | "cell_type": "code", |
225 | | - "execution_count": 5, |
| 227 | + "execution_count": 7, |
226 | 228 | "metadata": {}, |
227 | 229 | "outputs": [], |
228 | 230 | "source": [ |
|
244 | 246 | }, |
245 | 247 | { |
246 | 248 | "cell_type": "code", |
247 | | - "execution_count": 6, |
| 249 | + "execution_count": 8, |
248 | 250 | "metadata": {}, |
249 | 251 | "outputs": [], |
250 | 252 | "source": [ |
|
255 | 257 | }, |
256 | 258 | { |
257 | 259 | "cell_type": "code", |
258 | | - "execution_count": 7, |
| 260 | + "execution_count": 9, |
259 | 261 | "metadata": {}, |
260 | 262 | "outputs": [], |
261 | 263 | "source": [ |
|
266 | 268 | }, |
267 | 269 | { |
268 | 270 | "cell_type": "code", |
269 | | - "execution_count": 8, |
| 271 | + "execution_count": 10, |
270 | 272 | "metadata": {}, |
271 | 273 | "outputs": [ |
272 | 274 | { |
|
303 | 305 | "# Initialize the auto logger\n", |
304 | 306 | "# max_tuning_runs=None will make sure that all the runs are recorded.\n", |
305 | 307 | "# By default top 5 runs will be recorded for each experiment\n", |
306 | | - "```" |
| 308 | + "```\n", |
| 309 | + "**Step 3 - Start the experiment run**\n", |
| 310 | + "```python\n", |
| 311 | + "with mlflow.start_run() as run:\n", |
| 312 | + " clf.fit(X_train, y_train)\n", |
| 313 | + "```\n", |
| 314 | + "\n", |
| 315 | + "\n", |
| 316 | + "\n", |
| 317 | + "<img src=\"img/tracking_experiments_hyperparameters.JPG\">" |
307 | 318 | ] |
308 | 319 | }, |
309 | 320 | { |
310 | 321 | "cell_type": "code", |
311 | | - "execution_count": 9, |
| 322 | + "execution_count": 11, |
312 | 323 | "metadata": {}, |
313 | 324 | "outputs": [ |
314 | 325 | { |
315 | 326 | "data": { |
316 | 327 | "text/plain": [ |
317 | | - "<Experiment: artifact_location='file:///C:/Users/DELL/Desktop/github/bansalkanav/Machine_Learning_and_Deep_Learning/Module%205%20-%20MLOPs/3.%20Experiment%20Tracking%20and%20Model%20Management/mlruns/947285828145926172', creation_time=1710911744020, experiment_id='947285828145926172', last_update_time=1710911744020, lifecycle_stage='active', name='iris_species_prediction', tags={}>" |
| 328 | + "<Experiment: artifact_location='file:///C:/Users/DELL/Desktop/github/bansalkanav/Machine_Learning_and_Deep_Learning/Module%205%20-%20MLOPs/3.%20Experiment%20Tracking%20and%20Model%20Management/mlruns/315136114113215422', creation_time=1710940361468, experiment_id='315136114113215422', last_update_time=1710940361468, lifecycle_stage='active', name='iris_species_prediction', tags={}>" |
318 | 329 | ] |
319 | 330 | }, |
320 | | - "execution_count": 9, |
| 331 | + "execution_count": 11, |
321 | 332 | "metadata": {}, |
322 | 333 | "output_type": "execute_result" |
323 | 334 | } |
|
330 | 341 | }, |
331 | 342 | { |
332 | 343 | "cell_type": "code", |
333 | | - "execution_count": 10, |
| 344 | + "execution_count": 12, |
334 | 345 | "metadata": {}, |
335 | 346 | "outputs": [], |
336 | 347 | "source": [ |
|
355 | 366 | }, |
356 | 367 | { |
357 | 368 | "cell_type": "code", |
358 | | - "execution_count": 11, |
| 369 | + "execution_count": 13, |
359 | 370 | "metadata": {}, |
360 | 371 | "outputs": [ |
361 | 372 | { |
362 | 373 | "name": "stderr", |
363 | 374 | "output_type": "stream", |
364 | 375 | "text": [ |
365 | | - "2024/03/20 12:59:41 WARNING mlflow.utils.git_utils: Failed to import Git (the Git executable is probably not on your PATH), so Git SHA is not available. Error: Failed to initialize: Bad git executable.\n", |
| 376 | + "2024/03/20 18:47:40 WARNING mlflow.utils.git_utils: Failed to import Git (the Git executable is probably not on your PATH), so Git SHA is not available. Error: Failed to initialize: Bad git executable.\n", |
366 | 377 | "The git executable must be specified in one of the following ways:\n", |
367 | 378 | " - be included in your $PATH\n", |
368 | 379 | " - be set via $GIT_PYTHON_GIT_EXECUTABLE\n", |
|
386 | 397 | "output_type": "stream", |
387 | 398 | "text": [ |
388 | 399 | "Fitting 5 folds for each of 54 candidates, totalling 270 fits\n", |
389 | | - "CPU times: total: 20.2 s\n", |
390 | | - "Wall time: 26.2 s\n" |
| 400 | + "CPU times: total: 31 s\n", |
| 401 | + "Wall time: 40.8 s\n" |
391 | 402 | ] |
392 | 403 | } |
393 | 404 | ], |
|
419 | 430 | }, |
420 | 431 | { |
421 | 432 | "cell_type": "code", |
422 | | - "execution_count": 12, |
| 433 | + "execution_count": 14, |
423 | 434 | "metadata": {}, |
424 | 435 | "outputs": [], |
425 | 436 | "source": [ |
|
454 | 465 | }, |
455 | 466 | { |
456 | 467 | "cell_type": "code", |
457 | | - "execution_count": 13, |
| 468 | + "execution_count": 15, |
458 | 469 | "metadata": {}, |
459 | 470 | "outputs": [ |
460 | 471 | { |
461 | 472 | "name": "stdout", |
462 | 473 | "output_type": "stream", |
463 | 474 | "text": [ |
464 | 475 | "Fitting 5 folds for each of 60 candidates, totalling 300 fits\n", |
465 | | - "CPU times: total: 19 s\n", |
466 | | - "Wall time: 18.3 s\n" |
| 476 | + "CPU times: total: 22.3 s\n", |
| 477 | + "Wall time: 31.5 s\n" |
467 | 478 | ] |
468 | 479 | } |
469 | 480 | ], |
|
495 | 506 | }, |
496 | 507 | { |
497 | 508 | "cell_type": "code", |
498 | | - "execution_count": 14, |
| 509 | + "execution_count": 16, |
499 | 510 | "metadata": {}, |
500 | 511 | "outputs": [], |
501 | 512 | "source": [ |
|
595 | 606 | }, |
596 | 607 | { |
597 | 608 | "cell_type": "code", |
598 | | - "execution_count": 15, |
| 609 | + "execution_count": 17, |
599 | 610 | "metadata": {}, |
600 | 611 | "outputs": [ |
601 | 612 | { |
|
604 | 615 | "text": [ |
605 | 616 | "********** knn **********\n", |
606 | 617 | "Fitting 5 folds for each of 54 candidates, totalling 270 fits\n", |
607 | | - "CPU times: total: 18.4 s\n", |
608 | | - "Wall time: 18.3 s\n", |
| 618 | + "CPU times: total: 27 s\n", |
| 619 | + "Wall time: 36.8 s\n", |
609 | 620 | "Train Score: 0.9644268774703558\n", |
610 | 621 | "Test Score: 0.9736842105263158\n", |
611 | 622 | "\n", |
612 | 623 | "********** svc **********\n", |
613 | 624 | "Fitting 5 folds for each of 60 candidates, totalling 300 fits\n", |
614 | | - "CPU times: total: 18.3 s\n", |
615 | | - "Wall time: 17 s\n", |
| 625 | + "CPU times: total: 24 s\n", |
| 626 | + "Wall time: 26.6 s\n", |
616 | 627 | "Train Score: 0.9644268774703558\n", |
617 | 628 | "Test Score: 0.9736842105263158\n", |
618 | 629 | "\n", |
619 | 630 | "********** logistic_regression **********\n", |
620 | 631 | "Fitting 5 folds for each of 30 candidates, totalling 150 fits\n", |
621 | | - "CPU times: total: 10.9 s\n", |
622 | | - "Wall time: 12.4 s\n", |
| 632 | + "CPU times: total: 14.6 s\n", |
| 633 | + "Wall time: 23.2 s\n", |
623 | 634 | "Train Score: 0.9640316205533598\n", |
624 | 635 | "Test Score: 0.9736842105263158\n", |
625 | 636 | "\n", |
626 | 637 | "********** random_forest **********\n", |
627 | 638 | "Fitting 5 folds for each of 6 candidates, totalling 30 fits\n", |
628 | | - "CPU times: total: 11.2 s\n", |
629 | | - "Wall time: 16.8 s\n", |
| 639 | + "CPU times: total: 24.9 s\n", |
| 640 | + "Wall time: 36.5 s\n", |
630 | 641 | "Train Score: 0.9553359683794467\n", |
631 | 642 | "Test Score: 0.9736842105263158\n", |
632 | 643 | "\n", |
633 | 644 | "********** decision_tree **********\n", |
634 | 645 | "Fitting 5 folds for each of 6 candidates, totalling 30 fits\n", |
635 | | - "CPU times: total: 2.3 s\n", |
636 | | - "Wall time: 8.02 s\n", |
| 646 | + "CPU times: total: 3.66 s\n", |
| 647 | + "Wall time: 15.2 s\n", |
637 | 648 | "Train Score: 0.9640316205533598\n", |
638 | 649 | "Test Score: 0.9736842105263158\n", |
639 | 650 | "\n", |
640 | 651 | "********** naive_bayes **********\n", |
641 | 652 | "Fitting 5 folds for each of 2 candidates, totalling 10 fits\n", |
642 | | - "CPU times: total: 969 ms\n", |
643 | | - "Wall time: 6.9 s\n", |
| 653 | + "CPU times: total: 1.97 s\n", |
| 654 | + "Wall time: 15.2 s\n", |
644 | 655 | "Train Score: 0.9557312252964426\n", |
645 | 656 | "Test Score: 1.0\n", |
646 | 657 | "\n" |
|
894 | 905 | "3. **Production**: These versions are actively serving users in live environments.\n", |
895 | 906 | " - The \"Production\" tag refers to versions of software or code that are actively running in a live environment and serving end-users or customers.\n", |
896 | 907 | " - Production versions are expected to be stable, performant, and reliable, as they are handling real-world traffic and interactions.\n", |
897 | | - " - Changes to production versions often follow strict release procedures and may involve deployment strategies such as blue-green deployment or canary releases to minimize disruptions." |
| 908 | + " - Changes to production versions often follow strict release procedures and may involve deployment strategies such as blue-green deployment or canary releases to minimize disruptions.\n", |
| 909 | + " \n", |
| 910 | + "\n", |
| 911 | + "<img src=\"img/model_management.PNG\">\n" |
898 | 912 | ] |
899 | 913 | } |
900 | 914 | ], |
|
0 commit comments