{ "cells": [ { "cell_type": "markdown", "id": "0", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# AutoML with FLAML Library\n", "\n", "\n", "| | | | |\n", "|-----|--------|--------|--------|\n", "| \"drawing\" \n", "\n", "\n", "\n", "### Goal\n", "In this notebook, we demonstrate how to use AutoML with FLAML to find the best model for our dataset.\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", "with low computational cost. It is fast and economical. The simple and lightweight design makes it easy 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", "In this notebook, we use one real data example (binary classification) to showcase how to use FLAML library.\n", "\n", "FLAML requires `Python>=3.8`. To run this notebook example, please install the following packages." ] }, { "cell_type": "code", "execution_count": null, "id": "1", "metadata": { "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:45:27.1218348Z", "execution_start_time": "2024-09-03T04:45:00.4763917Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "edb1122f-690f-4826-ae22-f45c675bab46", "queued_time": "2024-09-03T04:44:51.3993564Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": "2024-09-03T04:44:51.4277029Z", "spark_pool": null, "state": "finished", "statement_id": 7, "statement_ids": [ 3, 4, 5, 6, 7 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 7, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Collecting openml==0.14.2\n", " Downloading openml-0.14.2.tar.gz (144 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m144.5/144.5 kB\u001b[0m \u001b[31m8.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25h Installing build dependencies ... \u001b[?25l-\b \b\\\b \b|\b \bdone\n", "\u001b[?25h Getting requirements to build wheel ... \u001b[?25l-\b \bdone\n", "\u001b[?25h Installing backend dependencies ... \u001b[?25l-\b \b\\\b \bdone\n", "\u001b[?25h Preparing metadata (pyproject.toml) ... \u001b[?25l-\b \bdone\n", "\u001b[?25hRequirement already satisfied: scikit-learn>=1.3.0 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (1.3.0)\n", "Collecting rgf-python==3.12.0\n", " Downloading rgf_python-3.12.0-py3-none-manylinux1_x86_64.whl (757 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m757.8/757.8 kB\u001b[0m \u001b[31m45.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: liac-arff>=2.4.0 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from openml==0.14.2) (2.5.0)\n", "Requirement already satisfied: xmltodict in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from openml==0.14.2) (0.13.0)\n", "Requirement already satisfied: requests in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from openml==0.14.2) (2.31.0)\n", "Requirement already satisfied: python-dateutil in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from openml==0.14.2) (2.8.2)\n", "Requirement already satisfied: pandas>=1.0.0 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from openml==0.14.2) (2.0.3)\n", "Requirement already satisfied: scipy>=0.13.3 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from openml==0.14.2) (1.10.1)\n", "Requirement already satisfied: numpy>=1.6.2 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from openml==0.14.2) (1.24.3)\n", "Collecting minio (from openml==0.14.2)\n", " Downloading minio-7.2.8-py3-none-any.whl (93 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m93.5/93.5 kB\u001b[0m \u001b[31m42.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: pyarrow in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from openml==0.14.2) (12.0.1)\n", "Requirement already satisfied: joblib in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from rgf-python==3.12.0) (1.3.2)\n", "Requirement already satisfied: threadpoolctl>=2.0.0 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from scikit-learn>=1.3.0) (3.2.0)\n", "Requirement already satisfied: pytz>=2020.1 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from pandas>=1.0.0->openml==0.14.2) (2023.3.post1)\n", "Requirement already satisfied: tzdata>=2022.1 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from pandas>=1.0.0->openml==0.14.2) (2023.3)\n", "Requirement already satisfied: six>=1.5 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from python-dateutil->openml==0.14.2) (1.16.0)\n", "Requirement already satisfied: certifi in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from minio->openml==0.14.2) (2023.7.22)\n", "Requirement already satisfied: urllib3 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from minio->openml==0.14.2) (1.26.17)\n", "Requirement already satisfied: argon2-cffi in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from minio->openml==0.14.2) (23.1.0)\n", "Collecting pycryptodome (from minio->openml==0.14.2)\n", " Downloading pycryptodome-3.20.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.1/2.1 MB\u001b[0m \u001b[31m146.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: typing-extensions in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from minio->openml==0.14.2) (4.5.0)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from requests->openml==0.14.2) (3.3.1)\n", "Requirement already satisfied: idna<4,>=2.5 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from requests->openml==0.14.2) (3.4)\n", "Requirement already satisfied: argon2-cffi-bindings in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from argon2-cffi->minio->openml==0.14.2) (21.2.0)\n", "Requirement already satisfied: cffi>=1.0.1 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from argon2-cffi-bindings->argon2-cffi->minio->openml==0.14.2) (1.16.0)\n", "Requirement already satisfied: pycparser in /home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->minio->openml==0.14.2) (2.21)\n", "Building wheels for collected packages: openml\n", " Building wheel for openml (pyproject.toml) ... \u001b[?25l-\b \b\\\b \bdone\n", "\u001b[?25h Created wheel for openml: filename=openml-0.14.2-py3-none-any.whl size=158697 sha256=284673299d0458cde5751ea69ec6de4e90e7410adec2b980af071fc934877200\n", " Stored in directory: /home/trusted-service-user/.cache/pip/wheels/2e/4e/af/5e721761d86375dbca82e63cc2470019e97815bc39f11451ea\n", "Successfully built openml\n", "Installing collected packages: pycryptodome, rgf-python, minio, openml\n", "Successfully installed minio-7.2.8 openml-0.14.2 pycryptodome-3.20.0 rgf-python-3.12.0\n", "\n", "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.1.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.2\u001b[0m\n", "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpython -m pip install --upgrade pip\u001b[0m\n", "Note: you may need to restart the kernel to use updated packages.\n", "Warning: PySpark kernel has been restarted to use updated packages.\n", "\n" ] } ], "source": [ "%pip install \"openml==0.14.2\" \"scikit-learn>=1.3.0\" \"rgf-python==3.12.0\"" ] }, { "cell_type": "markdown", "id": "2", "metadata": { "nteract": { "transient": { "deleting": false } } }, "source": [ "### Set the logging level\n", "\n", "You can configure the logging level to suppress unnecessary outputs to keep the logs cleaner." ] }, { "cell_type": "code", "execution_count": null, "id": "3", "metadata": { "jupyter": { "outputs_hidden": false, "source_hidden": false }, "nteract": { "transient": { "deleting": false } } }, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:45:32.370685Z", "execution_start_time": "2024-09-03T04:45:31.9932557Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "ab2d1ef3-9329-48e2-9429-71cd00e8af55", "queued_time": "2024-09-03T04:44:51.168749Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": null, "spark_pool": null, "state": "finished", "statement_id": 9, "statement_ids": [ 9 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 9, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import logging\n", "import warnings\n", " \n", "logging.getLogger('synapse.ml').setLevel(logging.CRITICAL)\n", "logging.getLogger('mlflow.utils').setLevel(logging.CRITICAL)\n", "warnings.simplefilter('ignore', category=FutureWarning)\n", "warnings.simplefilter('ignore', category=UserWarning)" ] }, { "cell_type": "markdown", "id": "4", "metadata": { "nteract": { "transient": { "deleting": false } } }, "source": [ "### Set up MLflow experiment tracking\n", "\n", "MLflow is an open source platform that is deeply integrated into the Data Science experience in Fabric and allows to easily track and compare the performance of different models and experiments without the need for manual tracking. For more information, see [Autologging in Microsoft Fabric](https://aka.ms/fabric-autologging)." ] }, { "cell_type": "code", "execution_count": null, "id": "5", "metadata": { "jupyter": { "outputs_hidden": false, "source_hidden": false }, "nteract": { "transient": { "deleting": false } } }, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:45:34.6803604Z", "execution_start_time": "2024-09-03T04:45:32.7740919Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "18d52168-8765-4f77-b8b8-a4539b51c1aa", "queued_time": "2024-09-03T04:44:51.1694279Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": null, "spark_pool": null, "state": "finished", "statement_id": 10, "statement_ids": [ 10 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 10, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import mlflow\n", "\n", "# Set the MLflow experiment to \"automl-tutorial\" and enable automatic logging\n", "mlflow.set_experiment(\"automl-tutorial\")" ] }, { "cell_type": "markdown", "id": "6", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## 2. Classification Example\n", "### 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." ] }, { "cell_type": "code", "execution_count": null, "id": "7", "metadata": { "jupyter": { "outputs_hidden": false }, "slideshow": { "slide_type": "subslide" }, "tags": [] }, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:45:55.4940947Z", "execution_start_time": "2024-09-03T04:45:35.0725962Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "ca8d70f5-47e5-4674-a31c-738f39ac3175", "queued_time": "2024-09-03T04:44:51.1702979Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": null, "spark_pool": null, "state": "finished", "statement_id": 11, "statement_ids": [ 11 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 11, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "No permission to create OpenML directory at /home/trusted-service-user/.config/openml! This can result in OpenML-Python not working properly.\n", "download dataset from openml\n", "Dataset name: airlines\n", "X_train.shape: (404537, 7), y_train.shape: (404537,);\n", "X_test.shape: (134846, 7), y_test.shape: (134846,)\n" ] } ], "source": [ "from flaml.automl.data import load_openml_dataset\n", "X_train, X_test, y_train, y_test = load_openml_dataset(dataset_id=1169, data_dir='./')" ] }, { "cell_type": "code", "execution_count": null, "id": "8", "metadata": {}, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:45:56.9587345Z", "execution_start_time": "2024-09-03T04:45:55.8839894Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "f5ca1611-8219-4ad8-aab8-478e625b31a6", "queued_time": "2024-09-03T04:44:51.1714393Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": null, "spark_pool": null, "state": "finished", "statement_id": 12, "statement_ids": [ 12 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 12, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.synapse.widget-view+json": { "widget_id": "e951537a-8f45-4ae7-8cd7-5835f56b7d40", "widget_type": "Synapse.DataFrame" }, "text/plain": [ "SynapseWidget(Synapse.DataFrame, e951537a-8f45-4ae7-8cd7-5835f56b7d40)" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "display(X_train.join(y_train))" ] }, { "cell_type": "markdown", "id": "9", "metadata": { "slideshow": { "slide_type": "slide" } }, "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 classifiers are `['lgbm', 'xgboost', 'xgb_limitdepth', 'catboost', 'rf', 'extra_tree', 'lrl1']`. " ] }, { "cell_type": "code", "execution_count": null, "id": "10", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:45:57.7243859Z", "execution_start_time": "2024-09-03T04:45:57.3434117Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "698ef231-f161-4732-b95c-2b7793946034", "queued_time": "2024-09-03T04:44:51.1728277Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": null, "spark_pool": null, "state": "finished", "statement_id": 13, "statement_ids": [ 13 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 13, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "''' import AutoML class from flaml package '''\n", "from flaml import AutoML\n", "automl = AutoML()" ] }, { "cell_type": "code", "execution_count": null, "id": "11", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:45:58.4767064Z", "execution_start_time": "2024-09-03T04:45:58.1184273Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "fa55a057-1d3e-4f40-800e-0b225e675b14", "queued_time": "2024-09-03T04:44:51.1751637Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": null, "spark_pool": null, "state": "finished", "statement_id": 14, "statement_ids": [ 14 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 14, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "settings = {\n", " \"time_budget\": 120, # total running time in seconds\n", " \"metric\": 'accuracy', # check the documentation for options of metrics (https://microsoft.github.io/FLAML/docs/Use-Cases/Task-Oriented-AutoML#optimization-metric)\n", " \"task\": 'classification', # task type\n", " \"seed\": 42, # random seed\n", "}" ] }, { "cell_type": "code", "execution_count": null, "id": "12", "metadata": { "slideshow": { "slide_type": "slide" }, "tags": [ "outputPrepend" ] }, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:48:28.7534447Z", "execution_start_time": "2024-09-03T04:45:58.882723Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "f261610f-4a20-4c09-8e00-645e1b2bb533", "queued_time": "2024-09-03T04:44:51.1773522Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": null, "spark_pool": null, "state": "finished", "statement_id": 15, "statement_ids": [ 15 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 15, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "[flaml.automl.logger: 09-03 04:46:00] {1787} INFO - task = classification\n", "[flaml.automl.logger: 09-03 04:46:00] {1798} INFO - Evaluation method: holdout\n", "[flaml.automl.logger: 09-03 04:46:00] {1901} INFO - Minimizing error metric: 1-accuracy\n", "[flaml.automl.logger: 09-03 04:46:01] {2019} INFO - List of ML learners in AutoML Run: ['lgbm', 'rf', 'xgboost', 'extra_tree', 'xgb_limitdepth', 'sgd', 'catboost', 'lrl1']\n", "[flaml.automl.logger: 09-03 04:46:01] {2329} INFO - iteration 0, current learner lgbm\n", "[flaml.automl.logger: 09-03 04:46:02] {2464} INFO - Estimated sufficient time budget=158419s. Estimated necessary time budget=3905s.\n" ] }, { "data": { "application/vnd.mlflow.run-widget+json": { "data": { "metrics": { "accuracy": 0.6223304330630809, "best_validation_loss": 0.3776695669369191, "iter_counter": 0, "trial_time": 0.4332137107849121, "validation_loss": 0.3776695669369191, "wall_clock_time": 2.640165090560913 }, "params": { "FLAML_sample_size": "10000", "colsample_bytree": "1.0", "learner": "lgbm", "learning_rate": "0.09999999999999995", "log_max_bin": "8", "min_child_samples": "20", "n_estimators": "4", "num_leaves": "4", "reg_alpha": "0.0009765625", "reg_lambda": "1.0", "sample_size": "10000" }, "tags": { "mlflow.parentRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.rootRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.runName": "flight_delays_baseline_child_0", "mlflow.user": "1b884fa3-ac7e-44f0-a171-1f215a13ecd4", "synapseml.experiment.artifactId": "d85e32e4-32da-4c71-986b-a0d0723750aa", "synapseml.experimentName": "automl-tutorial", "synapseml.flaml.automl_display_configurations": "{\"task\": null, \"automl_mode\": null, \"metric\": null, \"time_budget\": null, \"early_stop\": null, \"featurization\": null}", "synapseml.flaml.automl_user_configurations": "{}", "synapseml.flaml.best_run": "False", "synapseml.flaml.estimator_class": "LGBMEstimator", "synapseml.flaml.estimator_name": "lgbm", "synapseml.flaml.iteration_number": "0", "synapseml.flaml.learner": "lgbm", "synapseml.flaml.log_type": "r_autolog", "synapseml.flaml.meric": "accuracy", "synapseml.flaml.run_source": "flaml-automl", "synapseml.flaml.sample_size": "10000", "synapseml.flaml.version": "2.2.0.post1", "synapseml.livy.id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "synapseml.notebook.artifactId": "4305ee52-6e3d-4e54-8bc5-cd02304d23fc", "synapseml.user.id": "8abb9091-0a62-4ecd-bf6a-e49dbbf94431", "synapseml.user.name": "Li Jiang" } }, "info": { "artifact_uri": "sds://onelakemsit.pbidedicated.windows.net/c5eb3571-5221-4fd2-957a-456e893a6545/d85e32e4-32da-4c71-986b-a0d0723750aa/14aad3dc-eed4-4466-ad8e-8d5c138b6aac/artifacts", "end_time": 1725338787, "experiment_id": "0499e3cc-c690-4b30-86b9-55838e7df486", "lifecycle_stage": "active", "run_id": "14aad3dc-eed4-4466-ad8e-8d5c138b6aac", "run_name": "", "run_uuid": "14aad3dc-eed4-4466-ad8e-8d5c138b6aac", "start_time": 1725338762, "status": "FINISHED", "user_id": "e83b0ff5-f802-4776-bae4-11fe73ba932a" }, "inputs": { "dataset_inputs": [] } } }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "[flaml.automl.logger: 09-03 04:46:27] {2513} INFO - at 2.6s,\testimator lgbm's best error=0.3777,\tbest estimator lgbm's best error=0.3777\n", "[flaml.automl.logger: 09-03 04:46:27] {2329} INFO - iteration 1, current learner lgbm\n" ] }, { "data": { "application/vnd.mlflow.run-widget+json": { "data": { "metrics": { "accuracy": 0.6223304330630809, "best_validation_loss": 0.3776695669369191, "iter_counter": 1, "trial_time": 0.032134056091308594, "validation_loss": 0.3776695669369191, "wall_clock_time": 27.87287712097168 }, "params": { "FLAML_sample_size": "10000", "colsample_bytree": "0.9546978871157568", "learner": "lgbm", "learning_rate": "0.06631176582925748", "log_max_bin": "9", "min_child_samples": "17", "n_estimators": "5", "num_leaves": "4", "reg_alpha": "0.0020990359248076857", "reg_lambda": "21.92381099932143", "sample_size": "10000" }, "tags": { "mlflow.parentRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.rootRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.runName": "flight_delays_baseline_child_1", "mlflow.user": "1b884fa3-ac7e-44f0-a171-1f215a13ecd4", "synapseml.experiment.artifactId": "d85e32e4-32da-4c71-986b-a0d0723750aa", "synapseml.experimentName": "automl-tutorial", "synapseml.flaml.automl_display_configurations": "{\"task\": null, \"automl_mode\": null, \"metric\": null, \"time_budget\": null, \"early_stop\": null, \"featurization\": null}", "synapseml.flaml.automl_user_configurations": "{}", "synapseml.flaml.best_run": "False", "synapseml.flaml.estimator_class": "LGBMEstimator", "synapseml.flaml.estimator_name": "lgbm", "synapseml.flaml.iteration_number": "1", "synapseml.flaml.learner": "lgbm", "synapseml.flaml.log_type": "r_autolog", "synapseml.flaml.meric": "accuracy", "synapseml.flaml.run_source": "flaml-automl", "synapseml.flaml.sample_size": "10000", "synapseml.flaml.version": "2.2.0.post1", "synapseml.livy.id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "synapseml.notebook.artifactId": "4305ee52-6e3d-4e54-8bc5-cd02304d23fc", "synapseml.user.id": "8abb9091-0a62-4ecd-bf6a-e49dbbf94431", "synapseml.user.name": "Li Jiang" } }, "info": { "artifact_uri": "sds://onelakemsit.pbidedicated.windows.net/c5eb3571-5221-4fd2-957a-456e893a6545/d85e32e4-32da-4c71-986b-a0d0723750aa/4b351a28-0a7b-4b83-8a4e-0529c24ccba9/artifacts", "end_time": 1725338806, "experiment_id": "0499e3cc-c690-4b30-86b9-55838e7df486", "lifecycle_stage": "active", "run_id": "4b351a28-0a7b-4b83-8a4e-0529c24ccba9", "run_name": "", "run_uuid": "4b351a28-0a7b-4b83-8a4e-0529c24ccba9", "start_time": 1725338788, "status": "FINISHED", "user_id": "e83b0ff5-f802-4776-bae4-11fe73ba932a" }, "inputs": { "dataset_inputs": [] } } }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "[flaml.automl.logger: 09-03 04:46:46] {2513} INFO - at 27.9s,\testimator lgbm's best error=0.3777,\tbest estimator lgbm's best error=0.3777\n", "[flaml.automl.logger: 09-03 04:46:46] {2329} INFO - iteration 2, current learner lgbm\n" ] }, { "data": { "application/vnd.mlflow.run-widget+json": { "data": { "metrics": { "accuracy": 0.6236652165315404, "best_validation_loss": 0.3763347834684596, "iter_counter": 2, "trial_time": 0.04708147048950195, "validation_loss": 0.3763347834684596, "wall_clock_time": 47.18543338775635 }, "params": { "FLAML_sample_size": "10000", "colsample_bytree": "1.0", "learner": "lgbm", "learning_rate": "0.15080280060326612", "log_max_bin": "7", "min_child_samples": "24", "n_estimators": "4", "num_leaves": "10", "reg_alpha": "0.0009765625", "reg_lambda": "0.04561250779031766", "sample_size": "10000" }, "tags": { "mlflow.parentRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.rootRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.runName": "flight_delays_baseline_child_2", "mlflow.user": "1b884fa3-ac7e-44f0-a171-1f215a13ecd4", "synapseml.experiment.artifactId": "d85e32e4-32da-4c71-986b-a0d0723750aa", "synapseml.experimentName": "automl-tutorial", "synapseml.flaml.automl_display_configurations": "{\"task\": null, \"automl_mode\": null, \"metric\": null, \"time_budget\": null, \"early_stop\": null, \"featurization\": null}", "synapseml.flaml.automl_user_configurations": "{}", "synapseml.flaml.best_run": "False", "synapseml.flaml.estimator_class": "LGBMEstimator", "synapseml.flaml.estimator_name": "lgbm", "synapseml.flaml.iteration_number": "2", "synapseml.flaml.learner": "lgbm", "synapseml.flaml.log_type": "r_autolog", "synapseml.flaml.meric": "accuracy", "synapseml.flaml.run_source": "flaml-automl", "synapseml.flaml.sample_size": "10000", "synapseml.flaml.version": "2.2.0.post1", "synapseml.livy.id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "synapseml.notebook.artifactId": "4305ee52-6e3d-4e54-8bc5-cd02304d23fc", "synapseml.user.id": "8abb9091-0a62-4ecd-bf6a-e49dbbf94431", "synapseml.user.name": "Li Jiang" } }, "info": { "artifact_uri": "sds://onelakemsit.pbidedicated.windows.net/c5eb3571-5221-4fd2-957a-456e893a6545/d85e32e4-32da-4c71-986b-a0d0723750aa/81eac128-06f7-495e-afc5-d7792f17ab92/artifacts", "end_time": 1725338826, "experiment_id": "0499e3cc-c690-4b30-86b9-55838e7df486", "lifecycle_stage": "active", "run_id": "81eac128-06f7-495e-afc5-d7792f17ab92", "run_name": "", "run_uuid": "81eac128-06f7-495e-afc5-d7792f17ab92", "start_time": 1725338807, "status": "FINISHED", "user_id": "e83b0ff5-f802-4776-bae4-11fe73ba932a" }, "inputs": { "dataset_inputs": [] } } }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "[flaml.automl.logger: 09-03 04:47:07] {2513} INFO - at 47.2s,\testimator lgbm's best error=0.3763,\tbest estimator lgbm's best error=0.3763\n", "[flaml.automl.logger: 09-03 04:47:07] {2329} INFO - iteration 3, current learner lgbm\n" ] }, { "data": { "application/vnd.mlflow.run-widget+json": { "data": { "metrics": { "accuracy": 0.6365186869685584, "best_validation_loss": 0.3634813130314416, "iter_counter": 3, "trial_time": 0.04140424728393555, "validation_loss": 0.3634813130314416, "wall_clock_time": 67.61185884475708 }, "params": { "FLAML_sample_size": "10000", "colsample_bytree": "0.9006280463830675", "learner": "lgbm", "learning_rate": "0.2177704579511968", "log_max_bin": "6", "min_child_samples": "20", "n_estimators": "15", "num_leaves": "6", "reg_alpha": "0.0021638671012090007", "reg_lambda": "0.03731988103956423", "sample_size": "10000" }, "tags": { "mlflow.parentRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.rootRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.runName": "flight_delays_baseline_child_3", "mlflow.user": "1b884fa3-ac7e-44f0-a171-1f215a13ecd4", "synapseml.experiment.artifactId": "d85e32e4-32da-4c71-986b-a0d0723750aa", "synapseml.experimentName": "automl-tutorial", "synapseml.flaml.automl_display_configurations": "{\"task\": null, \"automl_mode\": null, \"metric\": null, \"time_budget\": null, \"early_stop\": null, \"featurization\": null}", "synapseml.flaml.automl_user_configurations": "{}", "synapseml.flaml.best_run": "False", "synapseml.flaml.estimator_class": "LGBMEstimator", "synapseml.flaml.estimator_name": "lgbm", "synapseml.flaml.iteration_number": "3", "synapseml.flaml.learner": "lgbm", "synapseml.flaml.log_type": "r_autolog", "synapseml.flaml.meric": "accuracy", "synapseml.flaml.run_source": "flaml-automl", "synapseml.flaml.sample_size": "10000", "synapseml.flaml.version": "2.2.0.post1", "synapseml.livy.id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "synapseml.notebook.artifactId": "4305ee52-6e3d-4e54-8bc5-cd02304d23fc", "synapseml.user.id": "8abb9091-0a62-4ecd-bf6a-e49dbbf94431", "synapseml.user.name": "Li Jiang" } }, "info": { "artifact_uri": "sds://onelakemsit.pbidedicated.windows.net/c5eb3571-5221-4fd2-957a-456e893a6545/d85e32e4-32da-4c71-986b-a0d0723750aa/25a86fd4-0939-4fbe-825b-548af7352935/artifacts", "end_time": 1725338847, "experiment_id": "0499e3cc-c690-4b30-86b9-55838e7df486", "lifecycle_stage": "active", "run_id": "25a86fd4-0939-4fbe-825b-548af7352935", "run_name": "", "run_uuid": "25a86fd4-0939-4fbe-825b-548af7352935", "start_time": 1725338827, "status": "FINISHED", "user_id": "e83b0ff5-f802-4776-bae4-11fe73ba932a" }, "inputs": { "dataset_inputs": [] } } }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "[flaml.automl.logger: 09-03 04:47:27] {2513} INFO - at 67.6s,\testimator lgbm's best error=0.3635,\tbest estimator lgbm's best error=0.3635\n", "[flaml.automl.logger: 09-03 04:47:27] {2329} INFO - iteration 4, current learner lgbm\n" ] }, { "data": { "application/vnd.mlflow.run-widget+json": { "data": { "metrics": { "accuracy": 0.6236404983191616, "best_validation_loss": 0.3634813130314416, "iter_counter": 4, "trial_time": 0.032787322998046875, "validation_loss": 0.3763595016808384, "wall_clock_time": 88.09981751441956 }, "params": { "FLAML_sample_size": "10000", "colsample_bytree": "1.0", "learner": "lgbm", "learning_rate": "0.15080280060326612", "log_max_bin": "8", "min_child_samples": "24", "n_estimators": "4", "num_leaves": "10", "reg_alpha": "0.0009765625", "reg_lambda": "0.04561250779031766", "sample_size": "10000" }, "tags": { "mlflow.parentRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.rootRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.runName": "flight_delays_baseline_child_4", "mlflow.user": "1b884fa3-ac7e-44f0-a171-1f215a13ecd4", "synapseml.experiment.artifactId": "d85e32e4-32da-4c71-986b-a0d0723750aa", "synapseml.experimentName": "automl-tutorial", "synapseml.flaml.automl_display_configurations": "{\"task\": null, \"automl_mode\": null, \"metric\": null, \"time_budget\": null, \"early_stop\": null, \"featurization\": null}", "synapseml.flaml.automl_user_configurations": "{}", "synapseml.flaml.best_run": "False", "synapseml.flaml.estimator_class": "LGBMEstimator", "synapseml.flaml.estimator_name": "lgbm", "synapseml.flaml.iteration_number": "4", "synapseml.flaml.learner": "lgbm", "synapseml.flaml.log_type": "r_autolog", "synapseml.flaml.meric": "accuracy", "synapseml.flaml.run_source": "flaml-automl", "synapseml.flaml.sample_size": "10000", "synapseml.flaml.version": "2.2.0.post1", "synapseml.livy.id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "synapseml.notebook.artifactId": "4305ee52-6e3d-4e54-8bc5-cd02304d23fc", "synapseml.user.id": "8abb9091-0a62-4ecd-bf6a-e49dbbf94431", "synapseml.user.name": "Li Jiang" } }, "info": { "artifact_uri": "sds://onelakemsit.pbidedicated.windows.net/c5eb3571-5221-4fd2-957a-456e893a6545/d85e32e4-32da-4c71-986b-a0d0723750aa/20063586-3f6e-4b7e-8edc-af22ed666853/artifacts", "end_time": 1725338865, "experiment_id": "0499e3cc-c690-4b30-86b9-55838e7df486", "lifecycle_stage": "active", "run_id": "20063586-3f6e-4b7e-8edc-af22ed666853", "run_name": "", "run_uuid": "20063586-3f6e-4b7e-8edc-af22ed666853", "start_time": 1725338848, "status": "FINISHED", "user_id": "e83b0ff5-f802-4776-bae4-11fe73ba932a" }, "inputs": { "dataset_inputs": [] } } }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "[flaml.automl.logger: 09-03 04:47:45] {2513} INFO - at 88.1s,\testimator lgbm's best error=0.3635,\tbest estimator lgbm's best error=0.3635\n", "[flaml.automl.logger: 09-03 04:47:45] {2329} INFO - iteration 5, current learner lgbm\n" ] }, { "data": { "application/vnd.mlflow.run-widget+json": { "data": { "metrics": { "accuracy": 0.6389163535693099, "best_validation_loss": 0.36108364643069013, "iter_counter": 5, "trial_time": 0.07941198348999023, "validation_loss": 0.36108364643069013, "wall_clock_time": 106.20823979377747 }, "params": { "FLAML_sample_size": "10000", "colsample_bytree": "0.8871559629536413", "learner": "lgbm", "learning_rate": "0.1292426830415275", "log_max_bin": "6", "min_child_samples": "14", "n_estimators": "66", "num_leaves": "4", "reg_alpha": "0.02960826033957992", "reg_lambda": "0.023368135622249268", "sample_size": "10000" }, "tags": { "mlflow.parentRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.rootRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.runName": "flight_delays_baseline_child_5", "mlflow.user": "1b884fa3-ac7e-44f0-a171-1f215a13ecd4", "synapseml.experiment.artifactId": "d85e32e4-32da-4c71-986b-a0d0723750aa", "synapseml.experimentName": "automl-tutorial", "synapseml.flaml.automl_display_configurations": "{\"task\": null, \"automl_mode\": null, \"metric\": null, \"time_budget\": null, \"early_stop\": null, \"featurization\": null}", "synapseml.flaml.automl_user_configurations": "{}", "synapseml.flaml.best_run": "False", "synapseml.flaml.estimator_class": "LGBMEstimator", "synapseml.flaml.estimator_name": "lgbm", "synapseml.flaml.iteration_number": "5", "synapseml.flaml.learner": "lgbm", "synapseml.flaml.log_type": "r_autolog", "synapseml.flaml.meric": "accuracy", "synapseml.flaml.run_source": "flaml-automl", "synapseml.flaml.sample_size": "10000", "synapseml.flaml.version": "2.2.0.post1", "synapseml.livy.id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "synapseml.notebook.artifactId": "4305ee52-6e3d-4e54-8bc5-cd02304d23fc", "synapseml.user.id": "8abb9091-0a62-4ecd-bf6a-e49dbbf94431", "synapseml.user.name": "Li Jiang" } }, "info": { "artifact_uri": "sds://onelakemsit.pbidedicated.windows.net/c5eb3571-5221-4fd2-957a-456e893a6545/d85e32e4-32da-4c71-986b-a0d0723750aa/4d4f70aa-e916-4ed9-8209-b99191c4d5e1/artifacts", "end_time": 1725338884, "experiment_id": "0499e3cc-c690-4b30-86b9-55838e7df486", "lifecycle_stage": "active", "run_id": "4d4f70aa-e916-4ed9-8209-b99191c4d5e1", "run_name": "", "run_uuid": "4d4f70aa-e916-4ed9-8209-b99191c4d5e1", "start_time": 1725338866, "status": "FINISHED", "user_id": "e83b0ff5-f802-4776-bae4-11fe73ba932a" }, "inputs": { "dataset_inputs": [] } } }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "[flaml.automl.logger: 09-03 04:48:05] {2513} INFO - at 106.2s,\testimator lgbm's best error=0.3611,\tbest estimator lgbm's best error=0.3611\n", "[flaml.automl.logger: 09-03 04:48:06] {569} INFO - logging best model lgbm\n", "[flaml.automl.logger: 09-03 04:48:09] {2756} INFO - retrain lgbm for 0.6s\n", "[flaml.automl.logger: 09-03 04:48:09] {2759} INFO - retrained model: LGBMClassifier(colsample_bytree=0.8871559629536413,\n", " learning_rate=0.1292426830415275, max_bin=63,\n", " min_child_samples=14, n_estimators=1, n_jobs=-1, num_leaves=4,\n", " reg_alpha=0.02960826033957992, reg_lambda=0.023368135622249268,\n", " verbose=-1)\n", "[flaml.automl.logger: 09-03 04:48:09] {2760} INFO - Auto Feature Engineering pipeline: None\n", "[flaml.automl.logger: 09-03 04:48:09] {2762} INFO - Best MLflow run name: \n", "[flaml.automl.logger: 09-03 04:48:09] {2763} INFO - Best MLflow run id: 4d4f70aa-e916-4ed9-8209-b99191c4d5e1\n", "[flaml.automl.logger: 09-03 04:48:27] {2055} INFO - fit succeeded\n", "[flaml.automl.logger: 09-03 04:48:27] {2056} INFO - Time taken to find the best model: 106.20823979377747\n" ] }, { "data": { "application/vnd.mlflow.run-widget+json": { "data": { "metrics": { "accuracy": 0.6389163535693099, "best_validation_loss": 0.36108364643069013, "iter_counter": 5, "trial_time": 0.07941198348999023, "validation_loss": 0.36108364643069013, "wall_clock_time": 106.20823979377747 }, "params": { "FLAML_sample_size": "10000", "best_learner": "lgbm", "colsample_bytree": "0.8871559629536413", "learner": "lgbm", "learning_rate": "0.1292426830415275", "log_max_bin": "6", "min_child_samples": "14", "n_estimators": "66", "num_leaves": "4", "reg_alpha": "0.02960826033957992", "reg_lambda": "0.023368135622249268", "sample_size": "10000" }, "tags": { "mlflow.rootRunId": "ca6ad732-f549-4374-9126-b3796d2cb671", "mlflow.runName": "flight_delays_baseline", "mlflow.user": "1b884fa3-ac7e-44f0-a171-1f215a13ecd4", "synapseml.experiment.artifactId": "d85e32e4-32da-4c71-986b-a0d0723750aa", "synapseml.experimentName": "automl-tutorial", "synapseml.flaml.automl_display_configurations": "{\"task\": null, \"automl_mode\": null, \"metric\": null, \"time_budget\": null, \"early_stop\": null, \"featurization\": null}", "synapseml.flaml.automl_user_configurations": "{}", "synapseml.flaml.best_run": "True", "synapseml.flaml.estimator_class": "LGBMEstimator", "synapseml.flaml.estimator_name": "lgbm", "synapseml.flaml.iteration_number": "5", "synapseml.flaml.learner": "lgbm", "synapseml.flaml.log_type": "r_autolog", "synapseml.flaml.meric": "accuracy", "synapseml.flaml.run_source": "flaml-automl", "synapseml.flaml.sample_size": "10000", "synapseml.flaml.version": "2.2.0.post1", "synapseml.livy.id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "synapseml.notebook.artifactId": "4305ee52-6e3d-4e54-8bc5-cd02304d23fc", "synapseml.user.id": "8abb9091-0a62-4ecd-bf6a-e49dbbf94431", "synapseml.user.name": "Li Jiang" } }, "info": { "artifact_uri": "sds://onelakemsit.pbidedicated.windows.net/c5eb3571-5221-4fd2-957a-456e893a6545/d85e32e4-32da-4c71-986b-a0d0723750aa/ca6ad732-f549-4374-9126-b3796d2cb671/artifacts", "end_time": 1725338907, "experiment_id": "0499e3cc-c690-4b30-86b9-55838e7df486", "lifecycle_stage": "active", "run_id": "ca6ad732-f549-4374-9126-b3796d2cb671", "run_name": "", "run_uuid": "ca6ad732-f549-4374-9126-b3796d2cb671", "start_time": 1725338759, "status": "FINISHED", "user_id": "e83b0ff5-f802-4776-bae4-11fe73ba932a" }, "inputs": { "dataset_inputs": [] } } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "'''The main flaml automl API'''\n", "with mlflow.start_run(run_name=\"flight_delays_baseline\"):\n", " automl.fit(X_train=X_train, y_train=y_train, **settings)" ] }, { "cell_type": "markdown", "id": "13", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Best model and metric" ] }, { "cell_type": "code", "execution_count": null, "id": "14", "metadata": { "slideshow": { "slide_type": "slide" }, "tags": [] }, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:48:29.5268906Z", "execution_start_time": "2024-09-03T04:48:29.1513034Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "25022243-df4f-4391-91b6-07701d41262f", "queued_time": "2024-09-03T04:44:51.1795881Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": null, "spark_pool": null, "state": "finished", "statement_id": 16, "statement_ids": [ 16 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 16, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Best ML leaner: lgbm\n", "Best hyperparmeter config: {'n_estimators': 66, 'num_leaves': 4, 'min_child_samples': 14, 'learning_rate': 0.1292426830415275, 'log_max_bin': 6, 'colsample_bytree': 0.8871559629536413, 'reg_alpha': 0.02960826033957992, 'reg_lambda': 0.023368135622249268}\n", "Best accuracy on validation data: 0.6389\n", "Training duration of best run: 0.5744 s\n" ] } ], "source": [ "'''retrieve best config and best learner'''\n", "print('Best ML leaner:', automl.best_estimator)\n", "print('Best hyperparmeter config:', automl.best_config)\n", "print('Best accuracy on validation data: {0:.4g}'.format(1-automl.best_loss))\n", "print('Training duration of best run: {0:.4g} s'.format(automl.best_config_train_time))" ] }, { "cell_type": "markdown", "id": "15", "metadata": {}, "source": [ "## 3. Model saving and prediction\n", "\n", "### Save model\n" ] }, { "cell_type": "code", "execution_count": null, "id": "16", "metadata": { "jupyter": { "outputs_hidden": false, "source_hidden": false }, "nteract": { "transient": { "deleting": false } } }, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:48:35.5551143Z", "execution_start_time": "2024-09-03T04:48:29.9813151Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "1a35f263-201c-43ae-8558-2903b57b1973", "queued_time": "2024-09-03T04:44:51.1817601Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": null, "spark_pool": null, "state": "finished", "statement_id": 17, "statement_ids": [ 17 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 17, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "Registered model 'flight_delays_baseline' already exists. Creating a new version of this model...\n", "2024/09/03 04:48:33 INFO mlflow.tracking._model_registry.client: Waiting up to 300 seconds for model version to finish creation. Model name: flight_delays_baseline, version 4\n", "Created version '4' of model 'flight_delays_baseline'.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Model 'flight_delays_baseline' version 4 registered successfully.\n" ] } ], "source": [ "model_path = f\"runs:/{automl.best_run_id}/model\"\n", "\n", "# Register the model to the MLflow registry\n", "registered_model = mlflow.register_model(model_uri=model_path, name=\"flight_delays_baseline\")\n", "\n", "# Print the registered model's name and version\n", "print(f\"Model '{registered_model.name}' version {registered_model.version} registered successfully.\")" ] }, { "cell_type": "markdown", "id": "17", "metadata": { "nteract": { "transient": { "deleting": false } } }, "source": [ "### Predict with saved model" ] }, { "cell_type": "code", "execution_count": null, "id": "18", "metadata": { "jupyter": { "outputs_hidden": false, "source_hidden": false }, "nteract": { "transient": { "deleting": false } } }, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:48:38.1921149Z", "execution_start_time": "2024-09-03T04:48:35.9728626Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "65b0cb5e-e7fb-4936-b5c2-c15bec521833", "queued_time": "2024-09-03T04:44:51.1840028Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": null, "spark_pool": null, "state": "finished", "statement_id": 18, "statement_ids": [ 18 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 18, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c145060f2a5943719ee2f8d11642df52", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading artifacts: 0%| | 0/5 [00:00" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.synapse.widget-view+json": { "widget_id": "01e178a6-4c9f-4b90-825f-a05558a8ee9e", "widget_type": "Synapse.DataFrame" }, "text/plain": [ "SynapseWidget(Synapse.DataFrame, 01e178a6-4c9f-4b90-825f-a05558a8ee9e)" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "transformer = automl.feature_transformer\n", "display(transformer)\n", "display(transformer.transform(X_test))" ] }, { "cell_type": "markdown", "id": "41", "metadata": { "nteract": { "transient": { "deleting": false } } }, "source": [ "## 7. Visualization\n", "The `flaml.visualization` module provides utility functions for plotting the optimization process using [plotly](https://plotly.com/python/). Leveraging `plotly`, users can interactively explore experiment results. To use these plotting functions, simply provide your Hyperparameter Tuning & AutoML experiment results as input. Optional parameters can be added using keyword arguments." ] }, { "cell_type": "markdown", "id": "42", "metadata": { "nteract": { "transient": { "deleting": false } } }, "source": [ "## Avaliable Plots\n", "- plot_contour: Plot the parameter relationship as contour plot in the experiment.\n", "- plot_edf: Plot the objective value EDF (empirical distribution function) of the experiment.\n", "- plot_feature_importance: Plot importance for each feature in the dataset.\n", "- plot_optimization_history: Plot optimization history of all trials in the experiment.\n", "- plot_parallel_coordinate: Plot the high-dimensional parameter relationships in the experiment.\n", "- plot_slice: Plot the parameter relationship as slice plot in a study.\n", "- plot_timeline: Plot the timeline of the experiment." ] }, { "cell_type": "code", "execution_count": null, "id": "43", "metadata": { "jupyter": { "outputs_hidden": false, "source_hidden": false }, "nteract": { "transient": { "deleting": false } } }, "outputs": [], "source": [ "import flaml.visualization as fviz\n", "fig = fviz.plot_slice(automl) # , params=['num_leaves', 'fe.extraction']\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": null, "id": "44", "metadata": { "jupyter": { "outputs_hidden": false, "source_hidden": false }, "nteract": { "transient": { "deleting": false } } }, "outputs": [], "source": [ "fig = fviz.plot_contour(automl, learner=\"RGF\", params=[\"max_leaf\", \"learning_rate\"])\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": null, "id": "45", "metadata": { "jupyter": { "outputs_hidden": false, "source_hidden": false }, "nteract": { "transient": { "deleting": false } } }, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:54:42.5267328Z", "execution_start_time": "2024-09-03T04:54:38.3407954Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "1d372090-9c00-419f-a7b4-a6e367dd0e31", "queued_time": "2024-09-03T04:44:51.2069779Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": null, "spark_pool": null, "state": "finished", "statement_id": 33, "statement_ids": [ 33 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 33, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hovertemplate": "learner=RGF
score=%{x}
probability=%{y}", "legendgroup": "RGF", "line": { "dash": "solid", "shape": "hv" }, "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "lines", "name": "RGF", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 0.2774926456265534, 0.2975153881801528, 0.3375967450617655, 0.34202913252868206 ], "xaxis": "x", "y": [ 0.25, 0.5, 0.75, 1 ], "yaxis": "y" }, { "hovertemplate": "learner=lgbm
score=%{x}
probability=%{y}", "legendgroup": "lgbm", "line": { "dash": "solid", "shape": "hv" }, "marker": { "color": "#EF553B", "symbol": "circle" }, "mode": "lines", "name": "lgbm", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 0.32111380593573424, 0.3228515011924623 ], "xaxis": "x", "y": [ 0.5, 1 ], "yaxis": "y" }, { "hovertemplate": "learner=xgboost
score=%{x}
probability=%{y}", "legendgroup": "xgboost", "line": { "dash": "solid", "shape": "hv" }, "marker": { "color": "#00cc96", "symbol": "circle" }, "mode": "lines", "name": "xgboost", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 0.3201826996070244 ], "xaxis": "x", "y": [ 1 ], "yaxis": "y" } ], "layout": { "legend": { "title": { "text": "learner" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Empirical Distribution Function" }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "Score" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "rangemode": "tozero", "title": { "text": "Probability" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig = fviz.plot_edf(automl)\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": null, "id": "46", "metadata": { "jupyter": { "outputs_hidden": false, "source_hidden": false }, "nteract": { "transient": { "deleting": false } } }, "outputs": [], "source": [ "fig = fviz.plot_optimization_history(automl)\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": null, "id": "47", "metadata": { "jupyter": { "outputs_hidden": false, "source_hidden": false }, "nteract": { "transient": { "deleting": false } } }, "outputs": [], "source": [ "fig = fviz.plot_timeline(automl)\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": null, "id": "48", "metadata": { "jupyter": { "outputs_hidden": false, "source_hidden": false }, "nteract": { "transient": { "deleting": false } } }, "outputs": [], "source": [ "fig = fviz.plot_feature_importance(automl)\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": null, "id": "49", "metadata": { "jupyter": { "outputs_hidden": false, "source_hidden": false }, "nteract": { "transient": { "deleting": false } } }, "outputs": [ { "data": { "application/vnd.livy.statement-meta+json": { "execution_finish_time": "2024-09-03T04:54:46.8278294Z", "execution_start_time": "2024-09-03T04:54:45.8054335Z", "livy_statement_state": "available", "normalized_state": "finished", "parent_msg_id": "3277a4ef-8679-424c-a2d1-7805471c6793", "queued_time": "2024-09-03T04:44:51.2103857Z", "session_id": "44ec0d80-7d47-447e-8932-68bbcc94ad2b", "session_start_time": null, "spark_pool": null, "state": "finished", "statement_id": 37, "statement_ids": [ 37 ] }, "text/plain": [ "StatementMeta(, 44ec0d80-7d47-447e-8932-68bbcc94ad2b, 37, Finished, Available, Finished)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "dimensions": [ { "label": "sample_size", "values": [ 10000, 10000, 10000, null, 10000 ] }, { "label": "max_leaf", "values": [ 4, 6, 4, null, 7 ] }, { "label": "n_iter", "values": [ 1, 1, 7, null, 85 ] }, { "label": "n_tree_search", "values": [ 1, 1, 2, null, 7 ] }, { "label": "opt_interval", "values": [ 100, 45, 224, null, 151 ] }, { "label": "min_samples_leaf", "values": [ 20, 16, 19, null, 19 ] }, { "label": "learning_rate", "values": [ 5.203358777802588, 15.174906417562942, 1.7841917324247605, null, 1.382765995393735 ] }, { "label": "FLAML_sample_size", "values": [ 10000, 10000, 10000, null, 10000 ] }, { "label": "score", "values": [ 0.3375967450617655, 0.2774926456265534, 0.34202913252868206, 0.2975153881801528, null ] } ], "domain": { "x": [ 0, 1 ], "y": [ 0, 1 ] }, "line": { "color": [ 0.3375967450617655, 0.2774926456265534, 0.34202913252868206, 0.2975153881801528, null ], "coloraxis": "coloraxis" }, "name": "", "type": "parcoords" } ], "layout": { "coloraxis": { "colorbar": { "title": { "text": "score" } }, "colorscale": [ [ 0, "rgb(7, 64, 80)" ], [ 0.16666666666666666, "rgb(16, 89, 101)" ], [ 0.3333333333333333, "rgb(33, 122, 121)" ], [ 0.5, "rgb(76, 155, 130)" ], [ 0.6666666666666666, "rgb(108, 192, 139)" ], [ 0.8333333333333334, "rgb(151, 225, 150)" ], [ 1, "rgb(211, 242, 163)" ] ] }, "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "automargin": true, "text": "Parallel Coordinate Plot for RGF", "y": 0.1 } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig = fviz.plot_parallel_coordinate(automl)\n", "fig.show()" ] } ], "metadata": { "a365ComputeOptions": null, "description": null, "kernel_info": { "name": "synapse_pyspark" }, "kernelspec": { "display_name": "Synapse PySpark", "language": "Python", "name": "synapse_pyspark" }, "language_info": { "name": "python" }, "nteract": { "version": "nteract-front-end@1.0.0" }, "save_output": true, "sessionKeepAliveTimeout": 0, "spark_compute": { "compute_id": "/trident/default" } }, "nbformat": 4, "nbformat_minor": 5 }