2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 "cells": [
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "cell_type": "markdown",
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "metadata": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "slideshow": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     "slide_type": "slide"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   },
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
									
										
										
										
											2022-06-21 18:59:07 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "Copyright (c) Microsoft Corporation. All rights reserved. \n",
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    "\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "Licensed under the MIT License.\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "# Run FLAML in AzureML\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "## 1. Introduction\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "FLAML is a Python library (https://github.com/microsoft/FLAML) designed to automatically produce accurate machine learning models \n",
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 13:39:09 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "with low computational cost. It is fast and economical. The simple and lightweight design makes it easy \n",
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    "to use and extend, such as adding new learners. FLAML can \n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "- serve as an economical AutoML engine,\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "- be used as a fast hyperparameter tuning tool, or \n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "- be embedded in self-tuning software that requires low latency & resource in repetitive\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "   tuning tasks.\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "\n",
							 
						 
					
						
							
								
									
										
										
										
											2021-02-22 22:10:41 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "In this notebook, we use one real data example (binary classification) to showcase how to use FLAML library together with AzureML.\n",
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    "\n",
							 
						 
					
						
							
								
									
										
										
										
											2022-06-21 18:59:07 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "FLAML requires `Python>=3.7`. To run this notebook example, please install flaml with the [azureml] option:\n",
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    "```bash\n",
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "pip install flaml[azureml]\n",
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    "```"
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "cell_type": "code",
							 
						 
					
						
							
								
									
										
										
										
											2021-02-17 14:03:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "execution_count": null,
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "metadata": {},
							 
						 
					
						
							
								
									
										
										
										
											2021-08-23 19:36:51 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "outputs": [],
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
									
										
										
										
											2022-06-24 04:45:42 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "%pip install flaml[azureml]"
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-02-17 14:03:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
									
										
										
										
											2021-02-22 22:10:41 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
									
										
										
										
											2021-07-20 17:00:44 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "cell_type": "markdown",
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "metadata": {},
							 
						 
					
						
							
								
									
										
										
										
											2021-02-22 22:10:41 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "### Enable mlflow in AzureML workspace"
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-02-22 22:10:41 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
									
										
										
										
											2021-02-17 14:03:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "cell_type": "code",
							 
						 
					
						
							
								
									
										
										
										
											2021-08-23 19:36:51 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "execution_count": null,
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "metadata": {},
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "outputs": [],
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "import mlflow\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "from azureml.core import Workspace\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "ws = Workspace.from_config()\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "mlflow.set_tracking_uri(ws.get_mlflow_tracking_uri())"
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "cell_type": "markdown",
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "metadata": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "slideshow": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     "slide_type": "slide"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   },
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
									
										
										
										
											2021-02-22 22:10:41 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "## 2. Classification Example\n",
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    "### Load data and preprocess\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "Download [Airlines dataset](https://www.openml.org/d/1169) from OpenML. The task is to predict whether a given flight will be delayed, given the information of the scheduled departure."
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "cell_type": "code",
							 
						 
					
						
							
								
									
										
										
										
											2021-08-23 19:36:51 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "execution_count": null,
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								   "metadata": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "slideshow": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     "slide_type": "subslide"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "tags": []
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "outputs": [],
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "from flaml.data import load_openml_dataset\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "X_train, X_test, y_train, y_test = load_openml_dataset(dataset_id=1169, data_dir='./')"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "cell_type": "markdown",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "metadata": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "slideshow": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     "slide_type": "slide"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "### Run FLAML\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "In the FLAML automl run configuration, users can specify the task type, time budget, error metric, learner list, whether to subsample, resampling strategy type, and so on. All these arguments have default values which will be used if users do not provide them. For example, the default ML learners of FLAML are `['lgbm', 'xgboost', 'catboost', 'rf', 'extra_tree', 'lrl1']`. "
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-08-23 19:36:51 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "cell_type": "code",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "execution_count": null,
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								   "metadata": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "slideshow": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     "slide_type": "slide"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "outputs": [],
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "''' import AutoML class from flaml package '''\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "from flaml import AutoML\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "automl = AutoML()"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-08-23 19:36:51 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "cell_type": "code",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "execution_count": null,
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "metadata": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "slideshow": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     "slide_type": "slide"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "outputs": [],
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "settings = {\n",
							 
						 
					
						
							
								
									
										
										
										
											2021-04-08 09:29:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "    \"time_budget\": 60,  # total running time in seconds\n",
							 
						 
					
						
							
								
									
										
										
										
											2021-09-01 16:25:04 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "    \"metric\": 'accuracy',  # can be: 'r2', 'rmse', 'mae', 'mse', 'accuracy', 'roc_auc', 'roc_auc_ovr',\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "                           # 'roc_auc_ovo', 'log_loss', 'mape', 'f1', 'ap', 'ndcg', 'micro_f1', 'macro_f1'\n",
							 
						 
					
						
							
								
									
										
										
										
											2021-04-08 09:29:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "    \"estimator_list\": ['lgbm', 'rf', 'xgboost'],  # list of ML learners\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "    \"task\": 'classification',  # task type    \n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "    \"sample\": False,  # whether to subsample training data\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "    \"log_file_name\": 'airlines_experiment.log',  # flaml log file\n",
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    "}"
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-08-23 19:36:51 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "cell_type": "code",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "execution_count": null,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "metadata": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "slideshow": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     "slide_type": "slide"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "tags": []
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   },
							 
						 
					
						
							
								
									
										
										
										
											2021-08-23 19:36:51 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "outputs": [],
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "experiment = mlflow.set_experiment(\"flaml\")\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "with mlflow.start_run() as run:\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "    automl.fit(X_train=X_train, y_train=y_train, **settings)\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "    # log the model\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "    mlflow.sklearn.log_model(automl, \"automl\")\n"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-08-23 19:36:51 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "cell_type": "markdown",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "metadata": {},
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "### Load the model"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-08-23 19:36:51 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "cell_type": "code",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "execution_count": null,
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "metadata": {},
							 
						 
					
						
							
								
									
										
										
										
											2021-08-23 19:36:51 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "outputs": [],
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    "automl = mlflow.sklearn.load_model(f\"{run.info.artifact_uri}/automl\")\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "print(automl.predict_proba(X_test))\n",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "print(automl.predict(X_test))"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "cell_type": "markdown",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "metadata": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "slideshow": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     "slide_type": "slide"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "### Retrieve logs"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "cell_type": "code",
							 
						 
					
						
							
								
									
										
										
										
											2021-08-23 19:36:51 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "execution_count": null,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "metadata": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "slideshow": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     "slide_type": "subslide"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "tags": []
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   },
							 
						 
					
						
							
								
									
										
										
										
											2021-08-23 19:36:51 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "outputs": [],
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "source": [
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "mlflow.search_runs(experiment_ids=[experiment.experiment_id], filter_string=\"params.learner = 'xgboost'\")"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   ]
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 ],
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 "metadata": {
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  "interpreter": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "hash": "0cfea3304185a9579d09e0953576b57c8581e46e6ebc6dfeb681bc5a511f7544"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  "kernelspec": {
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "display_name": "Python 3.8.0 64-bit ('blend': conda)",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "name": "python3"
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  "language_info": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "codemirror_mode": {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "name": "ipython",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    "version": 3
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "file_extension": ".py",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "mimetype": "text/x-python",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "name": "python",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "nbconvert_exporter": "python",
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   "pygments_lexer": "ipython3",
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   "version": "3.9.2"
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 21:41:14 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 "nbformat": 4,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 "nbformat_minor": 2
							 
						 
					
						
							
								
									
										
										
										
											2022-01-02 21:37:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}