FLAML/notebook/automl_classification.ipynb

2143 строки
163 KiB
Plaintext

{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"Copyright (c) Microsoft Corporation. All rights reserved. \n",
"\n",
"Licensed under the MIT License.\n",
"\n",
"# AutoML with FLAML Library\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 flaml with the `automl` option (this option is introduced from version 2, for version 1 it is installed by default):\n",
"```bash\n",
"pip install flaml[automl]\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# %pip install flaml[automl] matplotlib openml"
]
},
{
"attachments": {},
"cell_type": "markdown",
"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": 3,
"metadata": {
"slideshow": {
"slide_type": "subslide"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"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 minio.error import ServerError\n",
"from flaml.automl.data import load_openml_dataset\n",
"\n",
"try:\n",
" X_train, X_test, y_train, y_test = load_openml_dataset(dataset_id=1169, data_dir='./')\n",
"except (ServerError, Exception):\n",
" from sklearn.datasets import make_classification\n",
" from sklearn.model_selection import train_test_split\n",
" from pandas import DataFrame\n",
"\n",
" X, y = make_classification(n_samples=539383, n_features=7)\n",
" X = DataFrame(X)\n",
" X_train, X_test, y_train, y_test = train_test_split(X, y)\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Airline</th>\n",
" <th>Flight</th>\n",
" <th>AirportFrom</th>\n",
" <th>AirportTo</th>\n",
" <th>DayOfWeek</th>\n",
" <th>Time</th>\n",
" <th>Length</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>249392</th>\n",
" <td>EV</td>\n",
" <td>5309.0</td>\n",
" <td>MDT</td>\n",
" <td>ATL</td>\n",
" <td>3</td>\n",
" <td>794.0</td>\n",
" <td>131.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>166918</th>\n",
" <td>CO</td>\n",
" <td>1079.0</td>\n",
" <td>IAH</td>\n",
" <td>SAT</td>\n",
" <td>5</td>\n",
" <td>900.0</td>\n",
" <td>60.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>89110</th>\n",
" <td>US</td>\n",
" <td>1636.0</td>\n",
" <td>CLE</td>\n",
" <td>CLT</td>\n",
" <td>1</td>\n",
" <td>530.0</td>\n",
" <td>103.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>70258</th>\n",
" <td>WN</td>\n",
" <td>928.0</td>\n",
" <td>CMH</td>\n",
" <td>LAS</td>\n",
" <td>7</td>\n",
" <td>480.0</td>\n",
" <td>280.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>492985</th>\n",
" <td>WN</td>\n",
" <td>729.0</td>\n",
" <td>GEG</td>\n",
" <td>LAS</td>\n",
" <td>3</td>\n",
" <td>630.0</td>\n",
" <td>140.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Airline Flight AirportFrom AirportTo DayOfWeek Time Length\n",
"249392 EV 5309.0 MDT ATL 3 794.0 131.0\n",
"166918 CO 1079.0 IAH SAT 5 900.0 60.0\n",
"89110 US 1636.0 CLE CLT 1 530.0 103.0\n",
"70258 WN 928.0 CMH LAS 7 480.0 280.0\n",
"492985 WN 729.0 GEG LAS 3 630.0 140.0"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"X_train.head()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"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": 5,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [],
"source": [
"''' import AutoML class from flaml package '''\n",
"from flaml import AutoML\n",
"automl = AutoML()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [],
"source": [
"settings = {\n",
" \"time_budget\": 600, # total running time in seconds\n",
" \"metric\": 'accuracy', \n",
" # 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",
" \"log_file_name\": 'airlines_experiment.log', # flaml log file\n",
" \"seed\": 7654321, # random seed\n",
"}\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"slideshow": {
"slide_type": "slide"
},
"tags": [
"outputPrepend"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:20:40] {1663} INFO - task = classification\n",
"[flaml.automl.logger: 04-28 02:20:40] {1670} INFO - Data split method: stratified\n",
"[flaml.automl.logger: 04-28 02:20:40] {1673} INFO - Evaluation method: holdout\n",
"[flaml.automl.logger: 04-28 02:20:40] {1771} INFO - Minimizing error metric: 1-accuracy\n",
"[flaml.automl.logger: 04-28 02:20:41] {1881} INFO - List of ML learners in AutoML Run: ['lgbm', 'rf', 'catboost', 'xgboost', 'extra_tree', 'xgb_limitdepth', 'lrl1']\n",
"[flaml.automl.logger: 04-28 02:20:41] {2191} INFO - iteration 0, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:41] {2317} INFO - Estimated sufficient time budget=44511s. Estimated necessary time budget=1093s.\n",
"[flaml.automl.logger: 04-28 02:20:41] {2364} INFO - at 1.2s,\testimator lgbm's best error=0.3777,\tbest estimator lgbm's best error=0.3777\n",
"[flaml.automl.logger: 04-28 02:20:41] {2191} INFO - iteration 1, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:41] {2364} INFO - at 1.2s,\testimator lgbm's best error=0.3777,\tbest estimator lgbm's best error=0.3777\n",
"[flaml.automl.logger: 04-28 02:20:41] {2191} INFO - iteration 2, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:41] {2364} INFO - at 1.2s,\testimator lgbm's best error=0.3614,\tbest estimator lgbm's best error=0.3614\n",
"[flaml.automl.logger: 04-28 02:20:41] {2191} INFO - iteration 3, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:41] {2364} INFO - at 1.3s,\testimator lgbm's best error=0.3614,\tbest estimator lgbm's best error=0.3614\n",
"[flaml.automl.logger: 04-28 02:20:41] {2191} INFO - iteration 4, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:41] {2364} INFO - at 1.4s,\testimator lgbm's best error=0.3614,\tbest estimator lgbm's best error=0.3614\n",
"[flaml.automl.logger: 04-28 02:20:41] {2191} INFO - iteration 5, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:41] {2364} INFO - at 1.6s,\testimator lgbm's best error=0.3614,\tbest estimator lgbm's best error=0.3614\n",
"[flaml.automl.logger: 04-28 02:20:41] {2191} INFO - iteration 6, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:41] {2364} INFO - at 1.7s,\testimator lgbm's best error=0.3614,\tbest estimator lgbm's best error=0.3614\n",
"[flaml.automl.logger: 04-28 02:20:41] {2191} INFO - iteration 7, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:41] {2364} INFO - at 1.8s,\testimator lgbm's best error=0.3614,\tbest estimator lgbm's best error=0.3614\n",
"[flaml.automl.logger: 04-28 02:20:41] {2191} INFO - iteration 8, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:41] {2364} INFO - at 1.9s,\testimator lgbm's best error=0.3550,\tbest estimator lgbm's best error=0.3550\n",
"[flaml.automl.logger: 04-28 02:20:41] {2191} INFO - iteration 9, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.0s,\testimator xgboost's best error=0.3787,\tbest estimator lgbm's best error=0.3550\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 10, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.0s,\testimator xgboost's best error=0.3746,\tbest estimator lgbm's best error=0.3550\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 11, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.1s,\testimator extra_tree's best error=0.3787,\tbest estimator lgbm's best error=0.3550\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 12, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.1s,\testimator extra_tree's best error=0.3787,\tbest estimator lgbm's best error=0.3550\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 13, current learner extra_tree\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.2s,\testimator extra_tree's best error=0.3787,\tbest estimator lgbm's best error=0.3550\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 14, current learner rf\n",
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.2s,\testimator rf's best error=0.3816,\tbest estimator lgbm's best error=0.3550\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 15, current learner rf\n",
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.3s,\testimator rf's best error=0.3791,\tbest estimator lgbm's best error=0.3550\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 16, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.4s,\testimator lgbm's best error=0.3550,\tbest estimator lgbm's best error=0.3550\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 17, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.4s,\testimator xgboost's best error=0.3699,\tbest estimator lgbm's best error=0.3550\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 18, current learner lgbm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.7s,\testimator lgbm's best error=0.3545,\tbest estimator lgbm's best error=0.3545\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 19, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.8s,\testimator xgboost's best error=0.3596,\tbest estimator lgbm's best error=0.3545\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 20, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.8s,\testimator xgboost's best error=0.3596,\tbest estimator lgbm's best error=0.3545\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 21, current learner xgboost\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:20:42] {2364} INFO - at 2.9s,\testimator xgboost's best error=0.3596,\tbest estimator lgbm's best error=0.3545\n",
"[flaml.automl.logger: 04-28 02:20:42] {2191} INFO - iteration 22, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:43] {2364} INFO - at 3.1s,\testimator lgbm's best error=0.3545,\tbest estimator lgbm's best error=0.3545\n",
"[flaml.automl.logger: 04-28 02:20:43] {2191} INFO - iteration 23, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:43] {2364} INFO - at 3.6s,\testimator lgbm's best error=0.3545,\tbest estimator lgbm's best error=0.3545\n",
"[flaml.automl.logger: 04-28 02:20:43] {2191} INFO - iteration 24, current learner xgboost\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:20:43] {2364} INFO - at 3.9s,\testimator xgboost's best error=0.3586,\tbest estimator lgbm's best error=0.3545\n",
"[flaml.automl.logger: 04-28 02:20:43] {2191} INFO - iteration 25, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:20:44] {2364} INFO - at 4.0s,\testimator xgboost's best error=0.3577,\tbest estimator lgbm's best error=0.3545\n",
"[flaml.automl.logger: 04-28 02:20:44] {2191} INFO - iteration 26, current learner lgbm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:20:44] {2364} INFO - at 4.1s,\testimator lgbm's best error=0.3536,\tbest estimator lgbm's best error=0.3536\n",
"[flaml.automl.logger: 04-28 02:20:44] {2191} INFO - iteration 27, current learner rf\n",
"[flaml.automl.logger: 04-28 02:20:44] {2364} INFO - at 4.2s,\testimator rf's best error=0.3791,\tbest estimator lgbm's best error=0.3536\n",
"[flaml.automl.logger: 04-28 02:20:44] {2191} INFO - iteration 28, current learner xgboost\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:20:44] {2364} INFO - at 4.7s,\testimator xgboost's best error=0.3561,\tbest estimator lgbm's best error=0.3536\n",
"[flaml.automl.logger: 04-28 02:20:44] {2191} INFO - iteration 29, current learner xgboost\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:20:44] {2364} INFO - at 4.9s,\testimator xgboost's best error=0.3561,\tbest estimator lgbm's best error=0.3536\n",
"[flaml.automl.logger: 04-28 02:20:44] {2191} INFO - iteration 30, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:45] {2364} INFO - at 5.2s,\testimator lgbm's best error=0.3536,\tbest estimator lgbm's best error=0.3536\n",
"[flaml.automl.logger: 04-28 02:20:45] {2191} INFO - iteration 31, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:45] {2364} INFO - at 5.6s,\testimator lgbm's best error=0.3536,\tbest estimator lgbm's best error=0.3536\n",
"[flaml.automl.logger: 04-28 02:20:45] {2191} INFO - iteration 32, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:46] {2364} INFO - at 6.3s,\testimator lgbm's best error=0.3528,\tbest estimator lgbm's best error=0.3528\n",
"[flaml.automl.logger: 04-28 02:20:46] {2191} INFO - iteration 33, current learner xgboost\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:20:47] {2364} INFO - at 7.2s,\testimator xgboost's best error=0.3561,\tbest estimator lgbm's best error=0.3528\n",
"[flaml.automl.logger: 04-28 02:20:47] {2191} INFO - iteration 34, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:20:49] {2364} INFO - at 9.6s,\testimator lgbm's best error=0.3405,\tbest estimator lgbm's best error=0.3405\n",
"[flaml.automl.logger: 04-28 02:20:49] {2191} INFO - iteration 35, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:20:50] {2364} INFO - at 10.5s,\testimator catboost's best error=0.3587,\tbest estimator lgbm's best error=0.3405\n",
"[flaml.automl.logger: 04-28 02:20:50] {2191} INFO - iteration 36, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:20:50] {2364} INFO - at 10.8s,\testimator catboost's best error=0.3587,\tbest estimator lgbm's best error=0.3405\n",
"[flaml.automl.logger: 04-28 02:20:50] {2191} INFO - iteration 37, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:20:51] {2364} INFO - at 11.8s,\testimator catboost's best error=0.3587,\tbest estimator lgbm's best error=0.3405\n",
"[flaml.automl.logger: 04-28 02:20:51] {2191} INFO - iteration 38, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:20:56] {2364} INFO - at 16.9s,\testimator catboost's best error=0.3587,\tbest estimator lgbm's best error=0.3405\n",
"[flaml.automl.logger: 04-28 02:20:56] {2191} INFO - iteration 39, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:20:59] {2364} INFO - at 19.9s,\testimator catboost's best error=0.3483,\tbest estimator lgbm's best error=0.3405\n",
"[flaml.automl.logger: 04-28 02:20:59] {2191} INFO - iteration 40, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:21:00] {2364} INFO - at 20.7s,\testimator lgbm's best error=0.3405,\tbest estimator lgbm's best error=0.3405\n",
"[flaml.automl.logger: 04-28 02:21:00] {2191} INFO - iteration 41, current learner rf\n",
"[flaml.automl.logger: 04-28 02:21:00] {2364} INFO - at 20.8s,\testimator rf's best error=0.3791,\tbest estimator lgbm's best error=0.3405\n",
"[flaml.automl.logger: 04-28 02:21:00] {2191} INFO - iteration 42, current learner rf\n",
"[flaml.automl.logger: 04-28 02:21:00] {2364} INFO - at 20.8s,\testimator rf's best error=0.3789,\tbest estimator lgbm's best error=0.3405\n",
"[flaml.automl.logger: 04-28 02:21:00] {2191} INFO - iteration 43, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:21:03] {2364} INFO - at 23.2s,\testimator lgbm's best error=0.3370,\tbest estimator lgbm's best error=0.3370\n",
"[flaml.automl.logger: 04-28 02:21:03] {2191} INFO - iteration 44, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:21:05] {2364} INFO - at 25.8s,\testimator lgbm's best error=0.3370,\tbest estimator lgbm's best error=0.3370\n",
"[flaml.automl.logger: 04-28 02:21:05] {2191} INFO - iteration 45, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:21:05] {2364} INFO - at 25.8s,\testimator extra_tree's best error=0.3787,\tbest estimator lgbm's best error=0.3370\n",
"[flaml.automl.logger: 04-28 02:21:05] {2191} INFO - iteration 46, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:21:09] {2364} INFO - at 29.7s,\testimator lgbm's best error=0.3370,\tbest estimator lgbm's best error=0.3370\n",
"[flaml.automl.logger: 04-28 02:21:09] {2191} INFO - iteration 47, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:21:12] {2364} INFO - at 32.6s,\testimator lgbm's best error=0.3318,\tbest estimator lgbm's best error=0.3318\n",
"[flaml.automl.logger: 04-28 02:21:12] {2191} INFO - iteration 48, current learner xgb_limitdepth\n",
"[flaml.automl.logger: 04-28 02:21:12] {2364} INFO - at 32.7s,\testimator xgb_limitdepth's best error=0.3630,\tbest estimator lgbm's best error=0.3318\n",
"[flaml.automl.logger: 04-28 02:21:12] {2191} INFO - iteration 49, current learner xgb_limitdepth\n",
"[flaml.automl.logger: 04-28 02:21:12] {2364} INFO - at 32.7s,\testimator xgb_limitdepth's best error=0.3630,\tbest estimator lgbm's best error=0.3318\n",
"[flaml.automl.logger: 04-28 02:21:12] {2191} INFO - iteration 50, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:21:13] {2364} INFO - at 33.1s,\testimator xgb_limitdepth's best error=0.3630,\tbest estimator lgbm's best error=0.3318\n",
"[flaml.automl.logger: 04-28 02:21:13] {2191} INFO - iteration 51, current learner xgb_limitdepth\n",
"[flaml.automl.logger: 04-28 02:21:13] {2364} INFO - at 33.3s,\testimator xgb_limitdepth's best error=0.3572,\tbest estimator lgbm's best error=0.3318\n",
"[flaml.automl.logger: 04-28 02:21:13] {2191} INFO - iteration 52, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:21:14] {2364} INFO - at 34.0s,\testimator xgb_limitdepth's best error=0.3536,\tbest estimator lgbm's best error=0.3318\n",
"[flaml.automl.logger: 04-28 02:21:14] {2191} INFO - iteration 53, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:21:17] {2364} INFO - at 37.4s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:17] {2191} INFO - iteration 54, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:21:20] {2364} INFO - at 40.1s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:20] {2191} INFO - iteration 55, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:21:22] {2364} INFO - at 42.8s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:22] {2191} INFO - iteration 56, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:21:26] {2364} INFO - at 46.8s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:26] {2191} INFO - iteration 57, current learner xgb_limitdepth\n",
"[flaml.automl.logger: 04-28 02:21:27] {2364} INFO - at 47.0s,\testimator xgb_limitdepth's best error=0.3536,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:27] {2191} INFO - iteration 58, current learner lgbm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:21:30] {2364} INFO - at 50.0s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:30] {2191} INFO - iteration 59, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:21:33] {2364} INFO - at 53.0s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:33] {2191} INFO - iteration 60, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:21:34] {2364} INFO - at 54.9s,\testimator catboost's best error=0.3479,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:34] {2191} INFO - iteration 61, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:21:37] {2364} INFO - at 57.1s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:37] {2191} INFO - iteration 62, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:21:37] {2364} INFO - at 57.4s,\testimator xgb_limitdepth's best error=0.3536,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:37] {2191} INFO - iteration 63, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:21:41] {2364} INFO - at 61.8s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:41] {2191} INFO - iteration 64, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:21:42] {2364} INFO - at 62.0s,\testimator extra_tree's best error=0.3787,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:42] {2191} INFO - iteration 65, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:21:45] {2364} INFO - at 65.1s,\testimator xgb_limitdepth's best error=0.3516,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:45] {2191} INFO - iteration 66, current learner lrl1\n",
"[flaml.automl.logger: 04-28 02:21:45] {2364} INFO - at 65.2s,\testimator lrl1's best error=0.4338,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:45] {2191} INFO - iteration 67, current learner lrl1\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python3.9/site-packages/sklearn/linear_model/_sag.py:350: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge\n",
" warnings.warn(\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:21:45] {2364} INFO - at 65.4s,\testimator lrl1's best error=0.4338,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:45] {2191} INFO - iteration 68, current learner lrl1\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python3.9/site-packages/sklearn/linear_model/_sag.py:350: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge\n",
" warnings.warn(\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:21:45] {2364} INFO - at 65.7s,\testimator lrl1's best error=0.4338,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:45] {2191} INFO - iteration 69, current learner lrl1\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python3.9/site-packages/sklearn/linear_model/_sag.py:350: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge\n",
" warnings.warn(\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:21:46] {2364} INFO - at 66.5s,\testimator lrl1's best error=0.4334,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:46] {2191} INFO - iteration 70, current learner lgbm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python3.9/site-packages/sklearn/linear_model/_sag.py:350: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge\n",
" warnings.warn(\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:21:59] {2364} INFO - at 79.0s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:21:59] {2191} INFO - iteration 71, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:22:00] {2364} INFO - at 80.3s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:22:00] {2191} INFO - iteration 72, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:22:29] {2364} INFO - at 109.5s,\testimator catboost's best error=0.3479,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:22:29] {2191} INFO - iteration 73, current learner xgboost\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:22:31] {2364} INFO - at 111.9s,\testimator xgboost's best error=0.3561,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:22:31] {2191} INFO - iteration 74, current learner rf\n",
"[flaml.automl.logger: 04-28 02:22:32] {2364} INFO - at 112.0s,\testimator rf's best error=0.3781,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:22:32] {2191} INFO - iteration 75, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:22:32] {2364} INFO - at 112.4s,\testimator xgb_limitdepth's best error=0.3516,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:22:32] {2191} INFO - iteration 76, current learner rf\n",
"[flaml.automl.logger: 04-28 02:22:32] {2364} INFO - at 112.5s,\testimator rf's best error=0.3781,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:22:32] {2191} INFO - iteration 77, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:22:38] {2364} INFO - at 118.4s,\testimator xgb_limitdepth's best error=0.3516,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:22:38] {2191} INFO - iteration 78, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:23:03] {2364} INFO - at 143.6s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:03] {2191} INFO - iteration 79, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:23:04] {2364} INFO - at 144.3s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:04] {2191} INFO - iteration 80, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:04] {2364} INFO - at 144.4s,\testimator rf's best error=0.3725,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:04] {2191} INFO - iteration 81, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:04] {2364} INFO - at 144.5s,\testimator rf's best error=0.3725,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:04] {2191} INFO - iteration 82, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:04] {2364} INFO - at 144.6s,\testimator rf's best error=0.3725,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:04] {2191} INFO - iteration 83, current learner xgboost\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:23:06] {2364} INFO - at 146.4s,\testimator xgboost's best error=0.3555,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:06] {2191} INFO - iteration 84, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:06] {2364} INFO - at 146.5s,\testimator rf's best error=0.3706,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:06] {2191} INFO - iteration 85, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:06] {2364} INFO - at 146.7s,\testimator rf's best error=0.3706,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:06] {2191} INFO - iteration 86, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:06] {2364} INFO - at 146.8s,\testimator rf's best error=0.3706,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:06] {2191} INFO - iteration 87, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:23:06] {2364} INFO - at 146.9s,\testimator extra_tree's best error=0.3787,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:06] {2191} INFO - iteration 88, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:07] {2364} INFO - at 146.9s,\testimator rf's best error=0.3706,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:07] {2191} INFO - iteration 89, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:07] {2364} INFO - at 147.1s,\testimator rf's best error=0.3706,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:07] {2191} INFO - iteration 90, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:07] {2364} INFO - at 147.3s,\testimator rf's best error=0.3706,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:07] {2191} INFO - iteration 91, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:23:12] {2364} INFO - at 152.4s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:12] {2191} INFO - iteration 92, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:23:13] {2364} INFO - at 153.2s,\testimator xgb_limitdepth's best error=0.3516,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:13] {2191} INFO - iteration 93, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:13] {2364} INFO - at 153.4s,\testimator rf's best error=0.3678,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:13] {2191} INFO - iteration 94, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:23:15] {2364} INFO - at 155.7s,\testimator xgb_limitdepth's best error=0.3483,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:15] {2191} INFO - iteration 95, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:15] {2364} INFO - at 155.8s,\testimator rf's best error=0.3678,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:15] {2191} INFO - iteration 96, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:16] {2364} INFO - at 156.0s,\testimator rf's best error=0.3617,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:16] {2191} INFO - iteration 97, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:16] {2364} INFO - at 156.3s,\testimator rf's best error=0.3593,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:16] {2191} INFO - iteration 98, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:23:20] {2364} INFO - at 160.6s,\testimator xgb_limitdepth's best error=0.3483,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:20] {2191} INFO - iteration 99, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:21] {2364} INFO - at 161.0s,\testimator rf's best error=0.3593,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:21] {2191} INFO - iteration 100, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:21] {2364} INFO - at 161.5s,\testimator rf's best error=0.3593,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:21] {2191} INFO - iteration 101, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:21] {2364} INFO - at 161.9s,\testimator rf's best error=0.3593,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:21] {2191} INFO - iteration 102, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:23:26] {2364} INFO - at 166.1s,\testimator lgbm's best error=0.3282,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:26] {2191} INFO - iteration 103, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:23:28] {2364} INFO - at 168.5s,\testimator xgb_limitdepth's best error=0.3483,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:28] {2191} INFO - iteration 104, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:30] {2364} INFO - at 170.4s,\testimator rf's best error=0.3499,\tbest estimator lgbm's best error=0.3282\n",
"[flaml.automl.logger: 04-28 02:23:30] {2191} INFO - iteration 105, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:23:35] {2364} INFO - at 175.2s,\testimator lgbm's best error=0.3274,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:23:35] {2191} INFO - iteration 106, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:36] {2364} INFO - at 176.4s,\testimator rf's best error=0.3499,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:23:36] {2191} INFO - iteration 107, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:38] {2364} INFO - at 178.9s,\testimator rf's best error=0.3491,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:23:38] {2191} INFO - iteration 108, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:41] {2364} INFO - at 181.3s,\testimator rf's best error=0.3411,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:23:41] {2191} INFO - iteration 109, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:43] {2364} INFO - at 183.8s,\testimator rf's best error=0.3411,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:23:43] {2191} INFO - iteration 110, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:49] {2364} INFO - at 189.1s,\testimator rf's best error=0.3355,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:23:49] {2191} INFO - iteration 111, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:23:51] {2364} INFO - at 191.7s,\testimator xgb_limitdepth's best error=0.3483,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:23:51] {2191} INFO - iteration 112, current learner rf\n",
"[flaml.automl.logger: 04-28 02:23:54] {2364} INFO - at 194.4s,\testimator rf's best error=0.3355,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:23:54] {2191} INFO - iteration 113, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:23:56] {2364} INFO - at 196.8s,\testimator lgbm's best error=0.3274,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:23:56] {2191} INFO - iteration 114, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:24:14] {2364} INFO - at 214.9s,\testimator xgb_limitdepth's best error=0.3389,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:24:14] {2191} INFO - iteration 115, current learner rf\n",
"[flaml.automl.logger: 04-28 02:24:25] {2364} INFO - at 225.5s,\testimator rf's best error=0.3346,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:24:25] {2191} INFO - iteration 116, current learner lrl1\n",
"[flaml.automl.logger: 04-28 02:24:26] {2364} INFO - at 226.4s,\testimator lrl1's best error=0.4334,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:24:26] {2191} INFO - iteration 117, current learner lgbm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python3.9/site-packages/sklearn/linear_model/_sag.py:350: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge\n",
" warnings.warn(\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:24:27] {2364} INFO - at 227.9s,\testimator lgbm's best error=0.3274,\tbest estimator lgbm's best error=0.3274\n",
"[flaml.automl.logger: 04-28 02:24:27] {2191} INFO - iteration 118, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:24:37] {2364} INFO - at 237.0s,\testimator lgbm's best error=0.3268,\tbest estimator lgbm's best error=0.3268\n",
"[flaml.automl.logger: 04-28 02:24:37] {2191} INFO - iteration 119, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:25:01] {2364} INFO - at 261.0s,\testimator xgb_limitdepth's best error=0.3358,\tbest estimator lgbm's best error=0.3268\n",
"[flaml.automl.logger: 04-28 02:25:01] {2191} INFO - iteration 120, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:25:05] {2364} INFO - at 265.6s,\testimator lgbm's best error=0.3268,\tbest estimator lgbm's best error=0.3268\n",
"[flaml.automl.logger: 04-28 02:25:05] {2191} INFO - iteration 121, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:25:15] {2364} INFO - at 275.5s,\testimator lgbm's best error=0.3250,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:25:15] {2191} INFO - iteration 122, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:25:20] {2364} INFO - at 280.4s,\testimator lgbm's best error=0.3250,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:25:20] {2191} INFO - iteration 123, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:25:48] {2364} INFO - at 308.8s,\testimator lgbm's best error=0.3250,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:25:48] {2191} INFO - iteration 124, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:26:03] {2364} INFO - at 323.7s,\testimator xgb_limitdepth's best error=0.3358,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:26:03] {2191} INFO - iteration 125, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:26:15] {2364} INFO - at 335.6s,\testimator lgbm's best error=0.3250,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:26:15] {2191} INFO - iteration 126, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:26:25] {2364} INFO - at 345.2s,\testimator lgbm's best error=0.3250,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:26:25] {2191} INFO - iteration 127, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:26:30] {2364} INFO - at 350.2s,\testimator lgbm's best error=0.3250,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:26:30] {2191} INFO - iteration 128, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:26:45] {2364} INFO - at 365.5s,\testimator lgbm's best error=0.3250,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:26:45] {2191} INFO - iteration 129, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:26:47] {2364} INFO - at 367.6s,\testimator lgbm's best error=0.3250,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:26:47] {2191} INFO - iteration 130, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:27:31] {2364} INFO - at 411.1s,\testimator lgbm's best error=0.3250,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:27:31] {2191} INFO - iteration 131, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:27:54] {2364} INFO - at 434.4s,\testimator xgb_limitdepth's best error=0.3353,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:27:54] {2191} INFO - iteration 132, current learner rf\n",
"[flaml.automl.logger: 04-28 02:27:59] {2364} INFO - at 439.5s,\testimator rf's best error=0.3346,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:27:59] {2191} INFO - iteration 133, current learner rf\n",
"[flaml.automl.logger: 04-28 02:28:15] {2364} INFO - at 455.9s,\testimator rf's best error=0.3346,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:28:15] {2191} INFO - iteration 134, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:28:16] {2364} INFO - at 456.0s,\testimator extra_tree's best error=0.3786,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:28:16] {2191} INFO - iteration 135, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:29:38] {2364} INFO - at 538.9s,\testimator lgbm's best error=0.3250,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:29:38] {2191} INFO - iteration 136, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:29:40] {2364} INFO - at 540.3s,\testimator lgbm's best error=0.3250,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:29:40] {2191} INFO - iteration 137, current learner rf\n",
"[flaml.automl.logger: 04-28 02:29:46] {2364} INFO - at 546.6s,\testimator rf's best error=0.3346,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:29:46] {2191} INFO - iteration 138, current learner xgb_limitdepth\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:30:10] {2364} INFO - at 570.4s,\testimator xgb_limitdepth's best error=0.3353,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:30:10] {2191} INFO - iteration 139, current learner rf\n",
"[flaml.automl.logger: 04-28 02:30:35] {2364} INFO - at 595.2s,\testimator rf's best error=0.3336,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:30:35] {2191} INFO - iteration 140, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:30:39] {2364} INFO - at 599.8s,\testimator catboost's best error=0.3422,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:30:39] {2191} INFO - iteration 141, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:30:39] {2364} INFO - at 599.8s,\testimator extra_tree's best error=0.3786,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:30:39] {2191} INFO - iteration 142, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:30:39] {2364} INFO - at 599.8s,\testimator extra_tree's best error=0.3786,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:30:39] {2191} INFO - iteration 143, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:30:39] {2364} INFO - at 599.8s,\testimator extra_tree's best error=0.3786,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:30:39] {2191} INFO - iteration 144, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:30:39] {2364} INFO - at 599.9s,\testimator extra_tree's best error=0.3786,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:30:39] {2191} INFO - iteration 145, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:30:39] {2364} INFO - at 599.9s,\testimator extra_tree's best error=0.3786,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:30:39] {2191} INFO - iteration 146, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:30:39] {2364} INFO - at 599.9s,\testimator extra_tree's best error=0.3786,\tbest estimator lgbm's best error=0.3250\n",
"[flaml.automl.logger: 04-28 02:30:49] {2600} INFO - retrain lgbm for 9.5s\n",
"[flaml.automl.logger: 04-28 02:30:49] {2603} INFO - retrained model: LGBMClassifier(colsample_bytree=0.763983850698587,\n",
" learning_rate=0.087493667994037, max_bin=127,\n",
" min_child_samples=128, n_estimators=302, num_leaves=466,\n",
" reg_alpha=0.09968008477303378, reg_lambda=23.227419343318914,\n",
" verbose=-1)\n",
"[flaml.automl.logger: 04-28 02:30:49] {1911} INFO - fit succeeded\n",
"[flaml.automl.logger: 04-28 02:30:49] {1912} INFO - Time taken to find the best model: 275.4841866493225\n"
]
}
],
"source": [
"'''The main flaml automl API'''\n",
"automl.fit(X_train=X_train, y_train=y_train, **settings)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"### Best model and metric"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Best ML leaner: lgbm\n",
"Best hyperparmeter config: {'n_estimators': 302, 'num_leaves': 466, 'min_child_samples': 128, 'learning_rate': 0.087493667994037, 'log_max_bin': 7, 'colsample_bytree': 0.763983850698587, 'reg_alpha': 0.09968008477303378, 'reg_lambda': 23.227419343318914}\n",
"Best accuracy on validation data: 0.675\n",
"Training duration of best run: 9.453 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": "code",
"execution_count": 9,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"data": {
"text/html": [
"<style>#sk-container-id-1 {color: black;background-color: white;}#sk-container-id-1 pre{padding: 0;}#sk-container-id-1 div.sk-toggleable {background-color: white;}#sk-container-id-1 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-1 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-1 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-1 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-1 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-1 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-1 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-1 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-1 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-1 div.sk-item {position: relative;z-index: 1;}#sk-container-id-1 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-1 div.sk-item::before, #sk-container-id-1 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-1 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-1 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-1 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-1 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-1 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-1 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-1 div.sk-label-container {text-align: center;}#sk-container-id-1 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-1 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>LGBMClassifier(colsample_bytree=0.763983850698587,\n",
" learning_rate=0.087493667994037, max_bin=127,\n",
" min_child_samples=128, n_estimators=302, num_leaves=466,\n",
" reg_alpha=0.09968008477303378, reg_lambda=23.227419343318914,\n",
" verbose=-1)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" checked><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">LGBMClassifier</label><div class=\"sk-toggleable__content\"><pre>LGBMClassifier(colsample_bytree=0.763983850698587,\n",
" learning_rate=0.087493667994037, max_bin=127,\n",
" min_child_samples=128, n_estimators=302, num_leaves=466,\n",
" reg_alpha=0.09968008477303378, reg_lambda=23.227419343318914,\n",
" verbose=-1)</pre></div></div></div></div></div>"
],
"text/plain": [
"LGBMClassifier(colsample_bytree=0.763983850698587,\n",
" learning_rate=0.087493667994037, max_bin=127,\n",
" min_child_samples=128, n_estimators=302, num_leaves=466,\n",
" reg_alpha=0.09968008477303378, reg_lambda=23.227419343318914,\n",
" verbose=-1)"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"automl.model.estimator"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [],
"source": [
"'''pickle and save the automl object'''\n",
"import pickle\n",
"with open('automl.pkl', 'wb') as f:\n",
" pickle.dump(automl, f, pickle.HIGHEST_PROTOCOL)\n",
"'''load pickled automl object'''\n",
"with open('automl.pkl', 'rb') as f:\n",
" automl = pickle.load(f)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Predicted labels ['1' '0' '1' ... '1' '0' '0']\n",
"True labels 118331 0\n",
"328182 0\n",
"335454 0\n",
"520591 1\n",
"344651 0\n",
" ..\n",
"367080 0\n",
"203510 1\n",
"254894 0\n",
"296512 1\n",
"362444 0\n",
"Name: Delay, Length: 134846, dtype: category\n",
"Categories (2, object): ['0' < '1']\n"
]
}
],
"source": [
"'''compute predictions of testing dataset''' \n",
"y_pred = automl.predict(X_test)\n",
"print('Predicted labels', y_pred)\n",
"print('True labels', y_test)\n",
"y_pred_proba = automl.predict_proba(X_test)[:,1]"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"accuracy = 0.6732939797991784\n",
"roc_auc = 0.7276250346550404\n",
"log_loss = 0.6014655432027879\n"
]
}
],
"source": [
"''' compute different metric values on testing dataset'''\n",
"from flaml.ml import sklearn_metric_loss_score\n",
"print('accuracy', '=', 1 - sklearn_metric_loss_score('accuracy', y_pred, y_test))\n",
"print('roc_auc', '=', 1 - sklearn_metric_loss_score('roc_auc', y_pred_proba, y_test))\n",
"print('log_loss', '=', sklearn_metric_loss_score('log_loss', y_pred_proba, y_test))"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"See Section 4 for an accuracy comparison with default LightGBM and XGBoost.\n",
"\n",
"### Log history"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"slideshow": {
"slide_type": "subslide"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'Current Learner': 'lgbm', 'Current Sample': 10000, 'Current Hyper-parameters': {'n_estimators': 4, 'num_leaves': 4, 'min_child_samples': 20, 'learning_rate': 0.09999999999999995, 'log_max_bin': 8, 'colsample_bytree': 1.0, 'reg_alpha': 0.0009765625, 'reg_lambda': 1.0, 'FLAML_sample_size': 10000}, 'Best Learner': 'lgbm', 'Best Hyper-parameters': {'n_estimators': 4, 'num_leaves': 4, 'min_child_samples': 20, 'learning_rate': 0.09999999999999995, 'log_max_bin': 8, 'colsample_bytree': 1.0, 'reg_alpha': 0.0009765625, 'reg_lambda': 1.0, 'FLAML_sample_size': 10000}}\n",
"{'Current Learner': 'lgbm', 'Current Sample': 10000, 'Current Hyper-parameters': {'n_estimators': 26, 'num_leaves': 4, 'min_child_samples': 18, 'learning_rate': 0.2293009676418639, 'log_max_bin': 9, 'colsample_bytree': 0.9086551727646448, 'reg_alpha': 0.0015561782752413472, 'reg_lambda': 0.33127416269768944, 'FLAML_sample_size': 10000}, 'Best Learner': 'lgbm', 'Best Hyper-parameters': {'n_estimators': 26, 'num_leaves': 4, 'min_child_samples': 18, 'learning_rate': 0.2293009676418639, 'log_max_bin': 9, 'colsample_bytree': 0.9086551727646448, 'reg_alpha': 0.0015561782752413472, 'reg_lambda': 0.33127416269768944, 'FLAML_sample_size': 10000}}\n",
"{'Current Learner': 'lgbm', 'Current Sample': 40000, 'Current Hyper-parameters': {'n_estimators': 55, 'num_leaves': 4, 'min_child_samples': 20, 'learning_rate': 0.43653962213332903, 'log_max_bin': 10, 'colsample_bytree': 0.8048558760626646, 'reg_alpha': 0.0009765625, 'reg_lambda': 0.23010605579846408, 'FLAML_sample_size': 40000}, 'Best Learner': 'lgbm', 'Best Hyper-parameters': {'n_estimators': 55, 'num_leaves': 4, 'min_child_samples': 20, 'learning_rate': 0.43653962213332903, 'log_max_bin': 10, 'colsample_bytree': 0.8048558760626646, 'reg_alpha': 0.0009765625, 'reg_lambda': 0.23010605579846408, 'FLAML_sample_size': 40000}}\n",
"{'Current Learner': 'lgbm', 'Current Sample': 40000, 'Current Hyper-parameters': {'n_estimators': 90, 'num_leaves': 18, 'min_child_samples': 34, 'learning_rate': 0.3572626620529719, 'log_max_bin': 10, 'colsample_bytree': 0.9295656128173544, 'reg_alpha': 0.0009765625, 'reg_lambda': 0.1981463604305675, 'FLAML_sample_size': 40000}, 'Best Learner': 'lgbm', 'Best Hyper-parameters': {'n_estimators': 90, 'num_leaves': 18, 'min_child_samples': 34, 'learning_rate': 0.3572626620529719, 'log_max_bin': 10, 'colsample_bytree': 0.9295656128173544, 'reg_alpha': 0.0009765625, 'reg_lambda': 0.1981463604305675, 'FLAML_sample_size': 40000}}\n",
"{'Current Learner': 'lgbm', 'Current Sample': 40000, 'Current Hyper-parameters': {'n_estimators': 56, 'num_leaves': 7, 'min_child_samples': 92, 'learning_rate': 0.23536463281405412, 'log_max_bin': 10, 'colsample_bytree': 0.9898009552962395, 'reg_alpha': 0.0009765625, 'reg_lambda': 0.143294261726433, 'FLAML_sample_size': 40000}, 'Best Learner': 'lgbm', 'Best Hyper-parameters': {'n_estimators': 56, 'num_leaves': 7, 'min_child_samples': 92, 'learning_rate': 0.23536463281405412, 'log_max_bin': 10, 'colsample_bytree': 0.9898009552962395, 'reg_alpha': 0.0009765625, 'reg_lambda': 0.143294261726433, 'FLAML_sample_size': 40000}}\n",
"{'Current Learner': 'lgbm', 'Current Sample': 364083, 'Current Hyper-parameters': {'n_estimators': 56, 'num_leaves': 7, 'min_child_samples': 92, 'learning_rate': 0.23536463281405412, 'log_max_bin': 10, 'colsample_bytree': 0.9898009552962395, 'reg_alpha': 0.0009765625, 'reg_lambda': 0.143294261726433, 'FLAML_sample_size': 364083}, 'Best Learner': 'lgbm', 'Best Hyper-parameters': {'n_estimators': 56, 'num_leaves': 7, 'min_child_samples': 92, 'learning_rate': 0.23536463281405412, 'log_max_bin': 10, 'colsample_bytree': 0.9898009552962395, 'reg_alpha': 0.0009765625, 'reg_lambda': 0.143294261726433, 'FLAML_sample_size': 364083}}\n",
"{'Current Learner': 'lgbm', 'Current Sample': 364083, 'Current Hyper-parameters': {'n_estimators': 179, 'num_leaves': 27, 'min_child_samples': 75, 'learning_rate': 0.09744966359309021, 'log_max_bin': 10, 'colsample_bytree': 1.0, 'reg_alpha': 0.002826104794043855, 'reg_lambda': 0.145731823715616, 'FLAML_sample_size': 364083}, 'Best Learner': 'lgbm', 'Best Hyper-parameters': {'n_estimators': 179, 'num_leaves': 27, 'min_child_samples': 75, 'learning_rate': 0.09744966359309021, 'log_max_bin': 10, 'colsample_bytree': 1.0, 'reg_alpha': 0.002826104794043855, 'reg_lambda': 0.145731823715616, 'FLAML_sample_size': 364083}}\n",
"{'Current Learner': 'lgbm', 'Current Sample': 364083, 'Current Hyper-parameters': {'n_estimators': 180, 'num_leaves': 31, 'min_child_samples': 112, 'learning_rate': 0.14172261747380863, 'log_max_bin': 8, 'colsample_bytree': 0.9882716197099741, 'reg_alpha': 0.004676080321450302, 'reg_lambda': 2.7048628270368136, 'FLAML_sample_size': 364083}, 'Best Learner': 'lgbm', 'Best Hyper-parameters': {'n_estimators': 180, 'num_leaves': 31, 'min_child_samples': 112, 'learning_rate': 0.14172261747380863, 'log_max_bin': 8, 'colsample_bytree': 0.9882716197099741, 'reg_alpha': 0.004676080321450302, 'reg_lambda': 2.7048628270368136, 'FLAML_sample_size': 364083}}\n",
"{'Current Learner': 'lgbm', 'Current Sample': 364083, 'Current Hyper-parameters': {'n_estimators': 284, 'num_leaves': 24, 'min_child_samples': 57, 'learning_rate': 0.34506374431782616, 'log_max_bin': 8, 'colsample_bytree': 0.9661606582789269, 'reg_alpha': 0.05708594148438563, 'reg_lambda': 3.080643548412343, 'FLAML_sample_size': 364083}, 'Best Learner': 'lgbm', 'Best Hyper-parameters': {'n_estimators': 284, 'num_leaves': 24, 'min_child_samples': 57, 'learning_rate': 0.34506374431782616, 'log_max_bin': 8, 'colsample_bytree': 0.9661606582789269, 'reg_alpha': 0.05708594148438563, 'reg_lambda': 3.080643548412343, 'FLAML_sample_size': 364083}}\n",
"{'Current Learner': 'lgbm', 'Current Sample': 364083, 'Current Hyper-parameters': {'n_estimators': 150, 'num_leaves': 176, 'min_child_samples': 62, 'learning_rate': 0.2607939951456863, 'log_max_bin': 8, 'colsample_bytree': 1.0, 'reg_alpha': 0.015973158305354472, 'reg_lambda': 1.1581244082992237, 'FLAML_sample_size': 364083}, 'Best Learner': 'lgbm', 'Best Hyper-parameters': {'n_estimators': 150, 'num_leaves': 176, 'min_child_samples': 62, 'learning_rate': 0.2607939951456863, 'log_max_bin': 8, 'colsample_bytree': 1.0, 'reg_alpha': 0.015973158305354472, 'reg_lambda': 1.1581244082992237, 'FLAML_sample_size': 364083}}\n",
"{'Current Learner': 'lgbm', 'Current Sample': 364083, 'Current Hyper-parameters': {'n_estimators': 100, 'num_leaves': 380, 'min_child_samples': 83, 'learning_rate': 0.1439688182217924, 'log_max_bin': 7, 'colsample_bytree': 0.9365250834556608, 'reg_alpha': 0.07492795084698504, 'reg_lambda': 10.854898771631566, 'FLAML_sample_size': 364083}, 'Best Learner': 'lgbm', 'Best Hyper-parameters': {'n_estimators': 100, 'num_leaves': 380, 'min_child_samples': 83, 'learning_rate': 0.1439688182217924, 'log_max_bin': 7, 'colsample_bytree': 0.9365250834556608, 'reg_alpha': 0.07492795084698504, 'reg_lambda': 10.854898771631566, 'FLAML_sample_size': 364083}}\n",
"{'Current Learner': 'lgbm', 'Current Sample': 364083, 'Current Hyper-parameters': {'n_estimators': 157, 'num_leaves': 985, 'min_child_samples': 115, 'learning_rate': 0.15986853540486204, 'log_max_bin': 6, 'colsample_bytree': 0.8905312088154893, 'reg_alpha': 0.17376372850615002, 'reg_lambda': 196.8899439847594, 'FLAML_sample_size': 364083}, 'Best Learner': 'lgbm', 'Best Hyper-parameters': {'n_estimators': 157, 'num_leaves': 985, 'min_child_samples': 115, 'learning_rate': 0.15986853540486204, 'log_max_bin': 6, 'colsample_bytree': 0.8905312088154893, 'reg_alpha': 0.17376372850615002, 'reg_lambda': 196.8899439847594, 'FLAML_sample_size': 364083}}\n"
]
}
],
"source": [
"from flaml.automl.data import get_output_from_log\n",
"time_history, best_valid_loss_history, valid_loss_history, config_history, metric_history = \\\n",
" get_output_from_log(filename=settings['log_file_name'], time_budget=240)\n",
"for config in config_history:\n",
" print(config)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAHHCAYAAABXx+fLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8o6BhiAAAACXBIWXMAAA9hAAAPYQGoP6dpAABLuUlEQVR4nO3deVyU5f7/8feAbCrgAgOjobhEiUSWCxG5JYpWltbPzKNft451CJPCOuWjk2T1dTmdzDp2JC21ssXULEvFDJcWTU3LJPdcM3AjFld05v790dc5TaAyNMOA83o+HvN4MNdc983nvkl4d13Xfd8mwzAMAQAAeBEfTxcAAABQ1QhAAADA6xCAAACA1yEAAQAAr0MAAgAAXocABAAAvA4BCAAAeB0CEAAA8DoEIAAA4HUIQABqpOjoaA0dOtTTZQCooQhAgBebPXu2TCaTvv32W0+XUuOcOXNGL730khISEhQaGqrAwEDFxMRo5MiR2rlzp6fLA3AZtTxdAABUxo4dO+Tj45n/hzt27Jh69uypjRs36o477tBf/vIX1a1bVzt27ND777+v6dOnq7S01CO1AagYAhAAjzt//rxsNpv8/f0rvE1AQIAbK7q0oUOH6rvvvtP8+fN1zz33OHz23HPP6amnnnLJ96nMeQFQMUyBAbisQ4cOafjw4YqIiFBAQIBat26tmTNnOvQpLS3V2LFj1bZtW4WGhqpOnTrq2LGjVq5c6dBv3759MplM+te//qUpU6aoRYsWCggI0NatW/XMM8/IZDJp9+7dGjp0qOrVq6fQ0FANGzZMp06dctjPH9cAXZjO+/rrr5WRkaHw8HDVqVNHffv21dG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k2fPl3Tp08vt8+RI0fsX7/55pt68cUXtX37dp07d87e3qxZszLbldd2QZMmTRze169fX5L066+/KiQk5JI1X2pbSfYg1LJlS4d+DRo0sPe9lAvfv6SkRPXq1btsf2eVd17CwsLUrVs3ffDBB3ruueck/Tb9VatWLd199932frt27dIPP/xw0WD5+58V4O0IQAAu6sLC2UGDBmnIkCHl9omPj5ckzZkzR0OHDlWfPn30+OOPy2w2y9fXVxMmTNBPP/1UZrugoKCLfl9fX99y2w3DuGzNf2bbirj22mslSVu2bFHHjh0v299kMpX7va1Wa7n9L3Ze7rvvPg0bNkzff/+92rRpow8++EDdunVTWFiYvY/NZlP37t3197//vdx9xMTEXLZewFsQgABcVHh4uIKDg2W1WpWcnHzJvvPnz1fz5s314YcfOkxB/XHhrqc1bdpUkrR7926H0Zbjx4/bR4kupXfv3powYYLmzJlToQBUv3597dmzp0z7hZGoiurTp48efPBB+zTYzp07NWbMGIc+LVq00IkTJy77swLAZfAALsHX11f33HOPFixYoNzc3DKf//7y8gsjL78f7Vi3bp3Wrl3r/kKd0K1bN9WqVUvTpk1zaP/9peSXkpiYqJ49e+r111/XRx99VObz0tJSPfbYY/b3LVq00Pbt2x3O1ebNm/X11187VXe9evWUkpKiDz74QO+//778/f3Vp08fhz733nuv1q5dq2XLlpXZvrCwUOfPn3fqewJXMkaAAGjmzJnKzs4u056enq6JEydq5cqVSkhI0IgRIxQbG6uCggJt2rRJn3/+uQoKCiRJd9xxhz788EP17dtXt99+u/bu3ausrCzFxsbqxIkTVX1IFxUREaH09HS9+OKLuvPOO9WzZ09t3rxZS5cuVVhYmMPo1cW89dZb6tGjh+6++2717t1b3bp1U506dbRr1y69//77ysvLs98LaPjw4Zo8ebJSUlJ0//3368iRI8rKylLr1q0rtKj79/r3769BgwbpP//5j1JSUsqsQXr88ce1aNEi3XHHHRo6dKjatm2rkydPasuWLZo/f7727dvnMGUGeDMCEIAyoyEXDB06VFdddZXWr1+vZ599Vh9++KH+85//qGHDhmrdurXDfXm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A/f2FE8hIEAAANU9JSYlCQ0Mv2cejAcjf319t27ZVTk6O+vTpI+m3EZ6cnByNHDmy3G2SkpL07rvvymazycfntxm8nTt3ymKx2MOPYRh6+OGHtXDhQq1atUrNmjVzqq5GjRrp4MGDCg4Olsn05x9WWlxcrKioKB08eJBF1R7A+fcszr/ncO49i/Nf9QzDUElJiRo1anTZvh6fAsvIyNCQIUPUrl07dejQQVOmTNHJkyc1bNgwSdLgwYPVuHFjTZgwQZKUmpqqqVOnKj09XQ8//LB27dql8ePHa9SoUfZ9pqWl6d1339XHH3+s4OBg+3qi0NBQBQUFXbYmHx+fS44YVVZISAj/CDyI8+9ZnH/P4dx7Fue/al1u5OcCjweg/v376+jRoxo7dqzy8/PVpk0bZWdn2xdGHzhwwD7SI/02LbVs2TI9+uijio+PV+PGjZWenq4nnnjC3mfatGmSpC5dujh8r1mzZmno0KFuPyYAAFC9efw+QN6A+wp5Fuffszj/nsO59yzOf/Xm8TtBe4OAgABlZmY6LLRG1eH8exbn33M4957F+a/eGAECAABehxEgAADgdQhAAADA6xCAAACA1yEAAQAAr0MAqgKvvvqqoqOjFRgYqISEBK1fv97TJV1xnnnmGZlMJofXtddea//8zJkzSktLU8OGDVW3bl3dc889ZR7Bgor74osv1Lt3bzVq1Egmk0kfffSRw+eGYWjs2LGyWCwKCgpScnKydu3a5dCnoKBAAwcOVEhIiOrVq6f7779fJ06cqMKjqLkud/6HDh1a5t9Dz549Hfpw/itnwoQJat++vYKDg2U2m9WnTx/t2LHDoU9Fft8cOHBAt99+u2rXri2z2azHH39c58+fr8pD8XoEIDebO3euMjIylJmZqU2bNun6669XSkqKjhw54unSrjitW7dWXl6e/fX7B+A++uij+uSTTzRv3jytXr1av/zyi+6++24PVluznTx5Utdff71effXVcj//5z//qVdeeUVZWVlat26d6tSpo5SUFJ05c8beZ+DAgfrxxx+1fPly+zP7Hnjggao6hBrtcudfknr27Onw7+G9995z+JzzXzmrV69WWlqavvnmGy1fvlznzp1Tjx49dPLkSX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Q/RGAAC/StWtXnThxQt9++6297csvv1RkZKTWrVunM2fO2NtXrlypJk2aqEWLFm6p5bXXXlNycrIiIyO1YMECbd26VVlZWSoqKtKLL77olu/pjKioKOXl5dlfo0ePVuvWrR3a+vfvrwYNGig4ONgjNb7yyisaNmyYfHwq9qu8V69eKikp0dKlS91cGVD9EYAAL3LNNdfIYrFo1apV9rZVq1bprrvuUrNmzfTNN984tHft2lWS9Pbbb6tdu3YKDg5WZGSk/vKXv+jIkSOVruPnn3/WqFGjNGrUKM2cOVNdunRRdHS0OnXqpNdff11jx4696LbTpk1TixYt5O/vr2uuuUZvv/22w+eFhYV68MEHFRERocDAQMXFxenTTz8td19Hjx5Vu3bt1LdvX509e9bhM19fX0VGRtpfdevWVa1atRzagoKCykyBRUdH6/nnn9fgwYNVt25dNW3aVIsWLdLRo0d11113qW7duoqPj3cIoZL01VdfqWPHjgoKClJUVJRGjRqlkydPXvQ8HD16VCtWrFDv3r3tbYZh6JlnnlGTJk0UEBCgRo0aadSoUQ7HdNttt+n999+/6H4Bb0EAArxM165dtXLlSvv7lStXqkuXLurcubO9/fTp01q3bp09AJ07d07PPfecNm/erI8++kj79u3T0KFDK13DvHnzVFpaqr///e/lfn6xdToLFy5Uenq6Ro8erdzcXD344IMaNmyYvW6bzaZevXrp66+/1pw5c7R161ZNnDhRvr6+ZfZ18OBBdezYUXFxcZo/f74CAgIqfTx/9NJLLykpKUnfffedbr/9dv3P//yPBg8erEGDBmnTpk1q0aKFBg8erAvPov7pp5/Us2dP3XPPPfrhhx80d+5cffXVVxo5cuRFv8dXX32l2rVrq1WrVva2BQsW6KWXXtJrr72mXbt26aOPPtJ1113nsF2HDh305ZdfuuxYgRrLsw+jB1DVZsyYYdSpU8c4d+6cUVxcbNSqVcs4cuSI8e677xqdOnUyDMMwcnJyDEnG/v37y93Hhg0bDElGSUmJYRiGsXLlSkOS8euvvxqGYRizZs0yQkNDL1pDamqqERISctla/7ifm2++2RgxYoRDn379+hm33XabYRiGsWzZMsPHx8fYsWPHJfe3fft2Iyoqyhg1apRhs9kuW4dhGEZmZqZx/fXXl2nv3LmzkZ6ebn/ftGlTY9CgQfb3eXl5hiTj6aeftretXbvWkGTk5eUZhmEY999/v/HAAw847PfLL780fHx8jNOnT5dbz0svvWQ0b97coe3FF180YmJijNLS0osex8cff2z4+PgYVqv1on0Ab8AIEOBlunTpopMnT2rDhg368ssvFRMTo/DwcHXu3Nm+DmjVqlVq3ry5mjRpIknauHGjevfurSZNmig4OFidO3eWJB04cKBSNRiGIZPJ5PR227ZtU1JSkkNbUlKStm3bJkn6/vvvddVVVykmJuai+zh9+rQ6duyou+++Wy+//HKl6ric+Ph4+9cRERGS5DASc6HtwjTi5s2bNXv2bNWtW9f+SklJkc1m0969ey96HIGBgQ5t/fr10+nTp9W8eXONGDFCCxcudFjwLklBQUGy2WxlpvwAb0MAArxMy5YtddVVV2nlypVauXKlPcw0atRIUVFRWrNmjVauXKlbb71VknTy5EmlpKQoJCRE77zzjjZs2KCFCxdKkkpLSytVQ0xMjIqKipSXl+eag/o/QUFBl+0TEBCg5ORkffrpp2672szPz8/+9YWAVV7bhauxTpw4oQcffFDff/+9/bV582bt2rXroovQw8LC9Ouvvzq0RUVFaceOHfrPf/6joKAgPfTQQ+rUqZPOnTtn71NQUKA6depU6FwBVzICEOCFunbtqlWrVmnVqlUOl7936tRJS5cu1fr16+3rf7Zv367jx49r4sSJ6tixo6699to/tQBakv7f//t/8vf31z//+c9yP79wP6E/atWqlb7++muHtq+//lqxsbGSfht5+fnnn7Vz586Lfm8fHx+9/fbbatu2rbp27apffvmlcgfhQjfeeKO2bt2qli1blnn5+/uXu80NN9yg/Pz8MiEoKChIvXv31iuvvKJVq1Zp7dq12rJli/3z3Nxc3XDDDW49HqAmqOXpAgBUva5duyotLU3nzp2zjwBJUufOnTVy5EiVlpbaA1CTJk3k7++vf//73/rb3/6m3NzcP33fm6ioKL300ksaOXKkiouLNXjwYEVHR+vnn3/WW2+9pbp165Z7Kfzjjz+ue++9VzfccIOSk5P1ySef6MMPP9Tnn39ur79Tp0665557NHnyZLVs2VLbt2+XyWRSz5497fvx9fXVO++8owEDBujWW2/VqlWrFBkZ+aeO6c944okndNNNN2nkyJH661//qjp16mjr1q1avny5pk6dWu42N9xwg8LCwvT111/rjjvukPTbjR6tVqsSEhJUu3ZtzZkzR0FBQWratKl9uy+//FI9evSokuMCqjNGgAAv1LVrV50+fVotW7a0r0eRfgsQJSUl9svlJSk8PFyzZ8/WvHnzFBsbq4kTJ+pf//rXn67hoYce0meffaZDhw6pb9++uvbaa/XXv/5VISEheuyxx8rdpk+fPnr55Zf1r3/9S61bt9Zrr72mWbNmOYxiLViwQO3bt9eAAQMUGxurv//977JarWX2VatWLb333ntq3bq1br311j89qvVnxMfHa/Xq1dq5c6c6duyoG264QWPHjlWjRo0uuo2vr6+GDRumd955x95Wr149zZgxQ0lJSYqPj9fnn3+uTz75RA0bNpQkHTp0SGvWrNGwYcPcfkxAdWcyjP+7DhMAUKPk5+erdevW2rRpk8Moz8U88cQT+vXXXzV9+vQqqA6o3hgBAoAaKjIyUm+88UaFr8Yzm80ee2wHUN0wAgQAALwOI0AAAMDrEIAAAIDXIQABAACvQwACAABehwAEAAC8DgEIAAB4HQIQAADwOgQgAADgdQhAAADA6/x//IR49JpHKi4AAAAASUVORK5CYII=",
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"plt.title('Learning Curve')\n",
"plt.xlabel('Wall Clock Time (s)')\n",
"plt.ylabel('Validation Accuracy')\n",
"plt.scatter(time_history, 1 - np.array(valid_loss_history))\n",
"plt.step(time_history, 1 - np.array(best_valid_loss_history), where='post')\n",
"plt.show()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3. Comparison with alternatives\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"### Default LightGBM"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"from lightgbm import LGBMClassifier\n",
"lgbm = LGBMClassifier()"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<style>#sk-container-id-2 {color: black;background-color: white;}#sk-container-id-2 pre{padding: 0;}#sk-container-id-2 div.sk-toggleable {background-color: white;}#sk-container-id-2 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-2 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-2 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-2 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-2 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-2 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-2 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-2 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-2 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-2 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-2 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-2 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-2 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-2 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-2 div.sk-item {position: relative;z-index: 1;}#sk-container-id-2 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-2 div.sk-item::before, #sk-container-id-2 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-2 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-2 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-2 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-2 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-2 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-2 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-2 div.sk-label-container {text-align: center;}#sk-container-id-2 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-2 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-2\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>LGBMClassifier()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-2\" type=\"checkbox\" checked><label for=\"sk-estimator-id-2\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">LGBMClassifier</label><div class=\"sk-toggleable__content\"><pre>LGBMClassifier()</pre></div></div></div></div></div>"
],
"text/plain": [
"LGBMClassifier()"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lgbm.fit(X_train, y_train)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"y_pred_lgbm = lgbm.predict(X_test)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"### Default XGBoost"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
"from xgboost import XGBClassifier\n",
"xgb = XGBClassifier()\n",
"cat_columns = X_train.select_dtypes(include=['category']).columns\n",
"X = X_train.copy()\n",
"X[cat_columns] = X[cat_columns].apply(lambda x: x.cat.codes)\n",
"y_train_xgb = y_train.astype(\"int\")"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<style>#sk-container-id-3 {color: black;background-color: white;}#sk-container-id-3 pre{padding: 0;}#sk-container-id-3 div.sk-toggleable {background-color: white;}#sk-container-id-3 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-3 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-3 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-3 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-3 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-3 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-3 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-3 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-3 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-3 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-3 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-3 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-3 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-3 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-3 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-3 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-3 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-3 div.sk-item {position: relative;z-index: 1;}#sk-container-id-3 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-3 div.sk-item::before, #sk-container-id-3 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-3 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-3 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-3 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-3 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-3 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-3 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-3 div.sk-label-container {text-align: center;}#sk-container-id-3 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-3 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-3\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>XGBClassifier(base_score=None, booster=None, callbacks=None,\n",
" colsample_bylevel=None, colsample_bynode=None,\n",
" colsample_bytree=None, early_stopping_rounds=None,\n",
" enable_categorical=False, eval_metric=None, feature_types=None,\n",
" gamma=None, gpu_id=None, grow_policy=None, importance_type=None,\n",
" interaction_constraints=None, learning_rate=None, max_bin=None,\n",
" max_cat_threshold=None, max_cat_to_onehot=None,\n",
" max_delta_step=None, max_depth=None, max_leaves=None,\n",
" min_child_weight=None, missing=nan, monotone_constraints=None,\n",
" n_estimators=100, n_jobs=None, num_parallel_tree=None,\n",
" predictor=None, random_state=None, ...)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-3\" type=\"checkbox\" checked><label for=\"sk-estimator-id-3\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">XGBClassifier</label><div class=\"sk-toggleable__content\"><pre>XGBClassifier(base_score=None, booster=None, callbacks=None,\n",
" colsample_bylevel=None, colsample_bynode=None,\n",
" colsample_bytree=None, early_stopping_rounds=None,\n",
" enable_categorical=False, eval_metric=None, feature_types=None,\n",
" gamma=None, gpu_id=None, grow_policy=None, importance_type=None,\n",
" interaction_constraints=None, learning_rate=None, max_bin=None,\n",
" max_cat_threshold=None, max_cat_to_onehot=None,\n",
" max_delta_step=None, max_depth=None, max_leaves=None,\n",
" min_child_weight=None, missing=nan, monotone_constraints=None,\n",
" n_estimators=100, n_jobs=None, num_parallel_tree=None,\n",
" predictor=None, random_state=None, ...)</pre></div></div></div></div></div>"
],
"text/plain": [
"XGBClassifier(base_score=None, booster=None, callbacks=None,\n",
" colsample_bylevel=None, colsample_bynode=None,\n",
" colsample_bytree=None, early_stopping_rounds=None,\n",
" enable_categorical=False, eval_metric=None, feature_types=None,\n",
" gamma=None, gpu_id=None, grow_policy=None, importance_type=None,\n",
" interaction_constraints=None, learning_rate=None, max_bin=None,\n",
" max_cat_threshold=None, max_cat_to_onehot=None,\n",
" max_delta_step=None, max_depth=None, max_leaves=None,\n",
" min_child_weight=None, missing=nan, monotone_constraints=None,\n",
" n_estimators=100, n_jobs=None, num_parallel_tree=None,\n",
" predictor=None, random_state=None, ...)"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"xgb.fit(X, y_train_xgb)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"X = X_test.copy()\n",
"X[cat_columns] = X[cat_columns].apply(lambda x: x.cat.codes)\n",
"y_pred_xgb = xgb.predict(X)\n",
"y_test_xgb = y_test.astype(\"int\")\n"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"default xgboost accuracy = 0.6676060098186078\n",
"default lgbm accuracy = 0.6602346380315323\n",
"flaml (10 min) accuracy = 0.6732939797991784\n"
]
}
],
"source": [
"print('default xgboost accuracy', '=', 1 - sklearn_metric_loss_score('accuracy', y_pred_xgb, y_test_xgb))\n",
"print('default lgbm accuracy', '=', 1 - sklearn_metric_loss_score('accuracy', y_pred_lgbm, y_test))\n",
"print('flaml (10 min) accuracy', '=', 1 - sklearn_metric_loss_score('accuracy', y_pred, y_test))"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## 4. Customized Learner"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"Some experienced automl users may have a preferred model to tune or may already have a reasonably by-hand-tuned model before launching the automl experiment. They need to select optimal configurations for the customized model mixed with standard built-in learners. \n",
"\n",
"FLAML can easily incorporate customized/new learners (preferably with sklearn API) provided by users in a real-time manner, as demonstrated below."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"### Example of Regularized Greedy Forest\n",
"\n",
"[Regularized Greedy Forest](https://arxiv.org/abs/1109.0887) (RGF) is a machine learning method currently not included in FLAML. The RGF has many tuning parameters, the most critical of which are: `[max_leaf, n_iter, n_tree_search, opt_interval, min_samples_leaf]`. To run a customized/new learner, the user needs to provide the following information:\n",
"* an implementation of the customized/new learner\n",
"* a list of hyperparameter names and types\n",
"* rough ranges of hyperparameters (i.e., upper/lower bounds)\n",
"* choose initial value corresponding to low cost for cost-related hyperparameters (e.g., initial value for max_leaf and n_iter should be small)\n",
"\n",
"In this example, the above information for RGF is wrapped in a python class called *MyRegularizedGreedyForest* that exposes the hyperparameters."
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Defaulting to user installation because normal site-packages is not writeable\n",
"Requirement already satisfied: rgf-python in /home/vscode/.local/lib/python3.9/site-packages (3.12.0)\n",
"Requirement already satisfied: scikit-learn>=0.18 in /usr/local/lib/python3.9/site-packages (from rgf-python) (1.1.3)\n",
"Requirement already satisfied: joblib in /usr/local/lib/python3.9/site-packages (from rgf-python) (1.2.0)\n",
"Requirement already satisfied: scipy>=1.3.2 in /usr/local/lib/python3.9/site-packages (from scikit-learn>=0.18->rgf-python) (1.9.3)\n",
"Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.9/site-packages (from scikit-learn>=0.18->rgf-python) (3.1.0)\n",
"Requirement already satisfied: numpy>=1.17.3 in /home/vscode/.local/lib/python3.9/site-packages (from scikit-learn>=0.18->rgf-python) (1.23.5)\n",
"\u001b[33mWARNING: You are using pip version 22.0.4; however, version 23.1.1 is available.\n",
"You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.\u001b[0m\u001b[33m\n",
"\u001b[0mNote: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"%pip install rgf-python"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [],
"source": [
"''' SKLearnEstimator is the super class for a sklearn learner '''\n",
"from flaml.automl.model import SKLearnEstimator\n",
"from flaml import tune\n",
"from flaml.automl.task.task import CLASSIFICATION\n",
"\n",
"\n",
"class MyRegularizedGreedyForest(SKLearnEstimator):\n",
" def __init__(self, task='binary', **config):\n",
" '''Constructor\n",
" \n",
" Args:\n",
" task: A string of the task type, one of\n",
" 'binary', 'multiclass', 'regression'\n",
" config: A dictionary containing the hyperparameter names\n",
" and 'n_jobs' as keys. n_jobs is the number of parallel threads.\n",
" '''\n",
"\n",
" super().__init__(task, **config)\n",
"\n",
" '''task=binary or multi for classification task'''\n",
" if task in CLASSIFICATION:\n",
" from rgf.sklearn import RGFClassifier\n",
"\n",
" self.estimator_class = RGFClassifier\n",
" else:\n",
" from rgf.sklearn import RGFRegressor\n",
" \n",
" self.estimator_class = RGFRegressor\n",
"\n",
" @classmethod\n",
" def search_space(cls, data_size, task):\n",
" '''[required method] search space\n",
"\n",
" Returns:\n",
" A dictionary of the search space. \n",
" Each key is the name of a hyperparameter, and value is a dict with\n",
" its domain (required) and low_cost_init_value, init_value,\n",
" cat_hp_cost (if applicable).\n",
" e.g.,\n",
" {'domain': tune.randint(lower=1, upper=10), 'init_value': 1}.\n",
" '''\n",
" space = { \n",
" 'max_leaf': {'domain': tune.lograndint(lower=4, upper=data_size[0]), 'init_value': 4, 'low_cost_init_value': 4},\n",
" 'n_iter': {'domain': tune.lograndint(lower=1, upper=data_size[0]), 'init_value': 1, 'low_cost_init_value': 1},\n",
" 'n_tree_search': {'domain': tune.lograndint(lower=1, upper=32768), 'init_value': 1, 'low_cost_init_value': 1},\n",
" 'opt_interval': {'domain': tune.lograndint(lower=1, upper=10000), 'init_value': 100},\n",
" 'learning_rate': {'domain': tune.loguniform(lower=0.01, upper=20.0)},\n",
" 'min_samples_leaf': {'domain': tune.lograndint(lower=1, upper=20), 'init_value': 20},\n",
" }\n",
" return space\n",
"\n",
" @classmethod\n",
" def size(cls, config):\n",
" '''[optional method] memory size of the estimator in bytes\n",
" \n",
" Args:\n",
" config - the dict of the hyperparameter config\n",
"\n",
" Returns:\n",
" A float of the memory size required by the estimator to train the\n",
" given config\n",
" '''\n",
" max_leaves = int(round(config['max_leaf']))\n",
" n_estimators = int(round(config['n_iter']))\n",
" return (max_leaves * 3 + (max_leaves - 1) * 4 + 1.0) * n_estimators * 8\n",
"\n",
" @classmethod\n",
" def cost_relative2lgbm(cls):\n",
" '''[optional method] relative cost compared to lightgbm\n",
" '''\n",
" return 1.0\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"### Add Customized Learner and Run FLAML AutoML\n",
"\n",
"After adding RGF into the list of learners, we run automl by tuning hyperpameters of RGF as well as the default learners. "
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [],
"source": [
"automl = AutoML()\n",
"automl.add_learner(learner_name='RGF', learner_class=MyRegularizedGreedyForest)"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:31:18] {1663} INFO - task = classification\n",
"[flaml.automl.logger: 04-28 02:31:18] {1670} INFO - Data split method: stratified\n",
"[flaml.automl.logger: 04-28 02:31:18] {1673} INFO - Evaluation method: holdout\n",
"[flaml.automl.logger: 04-28 02:31:18] {1771} INFO - Minimizing error metric: 1-accuracy\n",
"[flaml.automl.logger: 04-28 02:31:18] {1881} INFO - List of ML learners in AutoML Run: ['RGF', 'lgbm', 'rf', 'xgboost']\n",
"[flaml.automl.logger: 04-28 02:31:18] {2191} INFO - iteration 0, current learner RGF\n",
"[flaml.automl.logger: 04-28 02:31:19] {2317} INFO - Estimated sufficient time budget=320931s. Estimated necessary time budget=321s.\n",
"[flaml.automl.logger: 04-28 02:31:19] {2364} INFO - at 1.4s,\testimator RGF's best error=0.3840,\tbest estimator RGF's best error=0.3840\n",
"[flaml.automl.logger: 04-28 02:31:19] {2191} INFO - iteration 1, current learner RGF\n",
"[flaml.automl.logger: 04-28 02:31:19] {2364} INFO - at 1.9s,\testimator RGF's best error=0.3840,\tbest estimator RGF's best error=0.3840\n",
"[flaml.automl.logger: 04-28 02:31:19] {2191} INFO - iteration 2, current learner RGF\n",
"[flaml.automl.logger: 04-28 02:31:20] {2364} INFO - at 2.3s,\testimator RGF's best error=0.3840,\tbest estimator RGF's best error=0.3840\n",
"[flaml.automl.logger: 04-28 02:31:20] {2191} INFO - iteration 3, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:20] {2364} INFO - at 2.4s,\testimator lgbm's best error=0.3777,\tbest estimator lgbm's best error=0.3777\n",
"[flaml.automl.logger: 04-28 02:31:20] {2191} INFO - iteration 4, current learner RGF\n",
"[flaml.automl.logger: 04-28 02:31:20] {2364} INFO - at 2.9s,\testimator RGF's best error=0.3840,\tbest estimator lgbm's best error=0.3777\n",
"[flaml.automl.logger: 04-28 02:31:20] {2191} INFO - iteration 5, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:20] {2364} INFO - at 2.9s,\testimator lgbm's best error=0.3777,\tbest estimator lgbm's best error=0.3777\n",
"[flaml.automl.logger: 04-28 02:31:20] {2191} INFO - iteration 6, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:20] {2364} INFO - at 2.9s,\testimator lgbm's best error=0.3777,\tbest estimator lgbm's best error=0.3777\n",
"[flaml.automl.logger: 04-28 02:31:20] {2191} INFO - iteration 7, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:20] {2364} INFO - at 3.0s,\testimator lgbm's best error=0.3661,\tbest estimator lgbm's best error=0.3661\n",
"[flaml.automl.logger: 04-28 02:31:20] {2191} INFO - iteration 8, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:20] {2364} INFO - at 3.0s,\testimator lgbm's best error=0.3661,\tbest estimator lgbm's best error=0.3661\n",
"[flaml.automl.logger: 04-28 02:31:21] {2191} INFO - iteration 9, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:21] {2364} INFO - at 3.1s,\testimator lgbm's best error=0.3633,\tbest estimator lgbm's best error=0.3633\n",
"[flaml.automl.logger: 04-28 02:31:21] {2191} INFO - iteration 10, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:21] {2364} INFO - at 3.2s,\testimator lgbm's best error=0.3633,\tbest estimator lgbm's best error=0.3633\n",
"[flaml.automl.logger: 04-28 02:31:21] {2191} INFO - iteration 11, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:21] {2364} INFO - at 3.2s,\testimator lgbm's best error=0.3633,\tbest estimator lgbm's best error=0.3633\n",
"[flaml.automl.logger: 04-28 02:31:21] {2191} INFO - iteration 12, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:21] {2364} INFO - at 3.3s,\testimator lgbm's best error=0.3613,\tbest estimator lgbm's best error=0.3613\n",
"[flaml.automl.logger: 04-28 02:31:21] {2191} INFO - iteration 13, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:21] {2364} INFO - at 3.3s,\testimator lgbm's best error=0.3613,\tbest estimator lgbm's best error=0.3613\n",
"[flaml.automl.logger: 04-28 02:31:21] {2191} INFO - iteration 14, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:21] {2364} INFO - at 3.5s,\testimator lgbm's best error=0.3591,\tbest estimator lgbm's best error=0.3591\n",
"[flaml.automl.logger: 04-28 02:31:21] {2191} INFO - iteration 15, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:21] {2364} INFO - at 3.6s,\testimator lgbm's best error=0.3591,\tbest estimator lgbm's best error=0.3591\n",
"[flaml.automl.logger: 04-28 02:31:21] {2191} INFO - iteration 16, current learner RGF\n",
"[flaml.automl.logger: 04-28 02:31:22] {2364} INFO - at 4.1s,\testimator RGF's best error=0.3840,\tbest estimator lgbm's best error=0.3591\n",
"[flaml.automl.logger: 04-28 02:31:22] {2191} INFO - iteration 17, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:22] {2364} INFO - at 4.2s,\testimator lgbm's best error=0.3591,\tbest estimator lgbm's best error=0.3591\n",
"[flaml.automl.logger: 04-28 02:31:22] {2191} INFO - iteration 18, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:22] {2364} INFO - at 4.3s,\testimator lgbm's best error=0.3589,\tbest estimator lgbm's best error=0.3589\n",
"[flaml.automl.logger: 04-28 02:31:22] {2191} INFO - iteration 19, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:22] {2364} INFO - at 4.5s,\testimator lgbm's best error=0.3587,\tbest estimator lgbm's best error=0.3587\n",
"[flaml.automl.logger: 04-28 02:31:22] {2191} INFO - iteration 20, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:22] {2364} INFO - at 4.6s,\testimator lgbm's best error=0.3587,\tbest estimator lgbm's best error=0.3587\n",
"[flaml.automl.logger: 04-28 02:31:22] {2191} INFO - iteration 21, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:22] {2364} INFO - at 4.7s,\testimator lgbm's best error=0.3587,\tbest estimator lgbm's best error=0.3587\n",
"[flaml.automl.logger: 04-28 02:31:22] {2191} INFO - iteration 22, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:22] {2364} INFO - at 4.8s,\testimator lgbm's best error=0.3587,\tbest estimator lgbm's best error=0.3587\n",
"[flaml.automl.logger: 04-28 02:31:22] {2191} INFO - iteration 23, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:22] {2364} INFO - at 5.0s,\testimator lgbm's best error=0.3587,\tbest estimator lgbm's best error=0.3587\n",
"[flaml.automl.logger: 04-28 02:31:22] {2191} INFO - iteration 24, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:23] {2364} INFO - at 5.2s,\testimator lgbm's best error=0.3587,\tbest estimator lgbm's best error=0.3587\n",
"[flaml.automl.logger: 04-28 02:31:23] {2191} INFO - iteration 25, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:23] {2364} INFO - at 5.3s,\testimator lgbm's best error=0.3587,\tbest estimator lgbm's best error=0.3587\n",
"[flaml.automl.logger: 04-28 02:31:23] {2191} INFO - iteration 26, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:23] {2364} INFO - at 5.4s,\testimator lgbm's best error=0.3587,\tbest estimator lgbm's best error=0.3587\n",
"[flaml.automl.logger: 04-28 02:31:23] {2191} INFO - iteration 27, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:23] {2364} INFO - at 5.6s,\testimator lgbm's best error=0.3587,\tbest estimator lgbm's best error=0.3587\n",
"[flaml.automl.logger: 04-28 02:31:23] {2191} INFO - iteration 28, current learner RGF\n",
"[flaml.automl.logger: 04-28 02:31:24] {2364} INFO - at 6.1s,\testimator RGF's best error=0.3766,\tbest estimator lgbm's best error=0.3587\n",
"[flaml.automl.logger: 04-28 02:31:24] {2191} INFO - iteration 29, current learner RGF\n",
"[flaml.automl.logger: 04-28 02:31:24] {2364} INFO - at 6.5s,\testimator RGF's best error=0.3766,\tbest estimator lgbm's best error=0.3587\n",
"[flaml.automl.logger: 04-28 02:31:24] {2191} INFO - iteration 30, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:24] {2364} INFO - at 6.6s,\testimator lgbm's best error=0.3587,\tbest estimator lgbm's best error=0.3587\n",
"[flaml.automl.logger: 04-28 02:31:24] {2191} INFO - iteration 31, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:24] {2364} INFO - at 6.9s,\testimator lgbm's best error=0.3575,\tbest estimator lgbm's best error=0.3575\n",
"[flaml.automl.logger: 04-28 02:31:24] {2191} INFO - iteration 32, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:25] {2364} INFO - at 7.1s,\testimator lgbm's best error=0.3575,\tbest estimator lgbm's best error=0.3575\n",
"[flaml.automl.logger: 04-28 02:31:25] {2191} INFO - iteration 33, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:25] {2364} INFO - at 7.3s,\testimator lgbm's best error=0.3575,\tbest estimator lgbm's best error=0.3575\n",
"[flaml.automl.logger: 04-28 02:31:25] {2191} INFO - iteration 34, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:25] {2364} INFO - at 7.6s,\testimator lgbm's best error=0.3537,\tbest estimator lgbm's best error=0.3537\n",
"[flaml.automl.logger: 04-28 02:31:25] {2191} INFO - iteration 35, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:25] {2364} INFO - at 7.7s,\testimator lgbm's best error=0.3537,\tbest estimator lgbm's best error=0.3537\n",
"[flaml.automl.logger: 04-28 02:31:25] {2191} INFO - iteration 36, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:25] {2364} INFO - at 7.9s,\testimator lgbm's best error=0.3537,\tbest estimator lgbm's best error=0.3537\n",
"[flaml.automl.logger: 04-28 02:31:25] {2191} INFO - iteration 37, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:26] {2364} INFO - at 8.1s,\testimator lgbm's best error=0.3530,\tbest estimator lgbm's best error=0.3530\n",
"[flaml.automl.logger: 04-28 02:31:26] {2191} INFO - iteration 38, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:26] {2364} INFO - at 8.2s,\testimator lgbm's best error=0.3530,\tbest estimator lgbm's best error=0.3530\n",
"[flaml.automl.logger: 04-28 02:31:26] {2191} INFO - iteration 39, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:26] {2364} INFO - at 8.3s,\testimator lgbm's best error=0.3530,\tbest estimator lgbm's best error=0.3530\n",
"[flaml.automl.logger: 04-28 02:31:26] {2191} INFO - iteration 40, current learner RGF\n",
"[flaml.automl.logger: 04-28 02:31:26] {2364} INFO - at 8.8s,\testimator RGF's best error=0.3766,\tbest estimator lgbm's best error=0.3530\n",
"[flaml.automl.logger: 04-28 02:31:26] {2191} INFO - iteration 41, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:26] {2364} INFO - at 8.9s,\testimator lgbm's best error=0.3530,\tbest estimator lgbm's best error=0.3530\n",
"[flaml.automl.logger: 04-28 02:31:26] {2191} INFO - iteration 42, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:26] {2364} INFO - at 9.0s,\testimator lgbm's best error=0.3530,\tbest estimator lgbm's best error=0.3530\n",
"[flaml.automl.logger: 04-28 02:31:26] {2191} INFO - iteration 43, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:26] {2364} INFO - at 9.0s,\testimator lgbm's best error=0.3530,\tbest estimator lgbm's best error=0.3530\n",
"[flaml.automl.logger: 04-28 02:31:26] {2191} INFO - iteration 44, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:27] {2364} INFO - at 9.1s,\testimator lgbm's best error=0.3530,\tbest estimator lgbm's best error=0.3530\n",
"[flaml.automl.logger: 04-28 02:31:27] {2191} INFO - iteration 45, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:27] {2364} INFO - at 9.1s,\testimator lgbm's best error=0.3530,\tbest estimator lgbm's best error=0.3530\n",
"[flaml.automl.logger: 04-28 02:31:27] {2191} INFO - iteration 46, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:27] {2364} INFO - at 9.2s,\testimator lgbm's best error=0.3530,\tbest estimator lgbm's best error=0.3530\n",
"[flaml.automl.logger: 04-28 02:31:27] {2191} INFO - iteration 47, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:28] {2364} INFO - at 10.2s,\testimator lgbm's best error=0.3430,\tbest estimator lgbm's best error=0.3430\n",
"[flaml.automl.logger: 04-28 02:31:59] {2600} INFO - retrain lgbm for 30.9s\n",
"[flaml.automl.logger: 04-28 02:31:59] {2603} INFO - retrained model: LGBMClassifier(colsample_bytree=0.521204713137351,\n",
" learning_rate=0.38514327038525437, max_bin=127,\n",
" min_child_samples=5, n_estimators=1159, num_leaves=35,\n",
" reg_alpha=0.007578110040801311, reg_lambda=0.03255827388036828,\n",
" verbose=-1)\n",
"[flaml.automl.logger: 04-28 02:31:59] {1911} INFO - fit succeeded\n",
"[flaml.automl.logger: 04-28 02:31:59] {1912} INFO - Time taken to find the best model: 10.156839609146118\n"
]
}
],
"source": [
"settings = {\n",
" \"time_budget\": 10, # total running time in seconds\n",
" \"metric\": 'accuracy', \n",
" \"estimator_list\": ['RGF', 'lgbm', 'rf', 'xgboost'], # list of ML learners\n",
" \"task\": 'classification', # task type \n",
" \"log_file_name\": 'airlines_experiment_custom_learner.log', # flaml log file \n",
" \"log_training_metric\": True, # whether to log training metric\n",
"}\n",
"\n",
"automl.fit(X_train=X_train, y_train=y_train, **settings)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## 5. Customized Metric\n",
"\n",
"It's also easy to customize the optimization metric. As an example, we demonstrate with a custom metric function which combines training loss and validation loss as the final loss to minimize."
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"def custom_metric(X_val, y_val, estimator, labels, X_train, y_train,\n",
" weight_val=None, weight_train=None, config=None,\n",
" groups_val=None, groups_train=None):\n",
" from sklearn.metrics import log_loss\n",
" import time\n",
" start = time.time()\n",
" y_pred = estimator.predict_proba(X_val)\n",
" pred_time = (time.time() - start) / len(X_val)\n",
" val_loss = log_loss(y_val, y_pred, labels=labels,\n",
" sample_weight=weight_val)\n",
" y_pred = estimator.predict_proba(X_train)\n",
" train_loss = log_loss(y_train, y_pred, labels=labels,\n",
" sample_weight=weight_train)\n",
" alpha = 0.5\n",
" return val_loss * (1 + alpha) - alpha * train_loss, {\n",
" \"val_loss\": val_loss, \"train_loss\": train_loss, \"pred_time\": pred_time\n",
" }\n",
" # two elements are returned:\n",
" # the first element is the metric to minimize as a float number,\n",
" # the second element is a dictionary of the metrics to log"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"We can then pass this custom metric function to automl's `fit` method."
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:31:59] {1663} INFO - task = classification\n",
"[flaml.automl.logger: 04-28 02:31:59] {1670} INFO - Data split method: stratified\n",
"[flaml.automl.logger: 04-28 02:31:59] {1673} INFO - Evaluation method: holdout\n",
"[flaml.automl.logger: 04-28 02:31:59] {1771} INFO - Minimizing error metric: customized metric\n",
"[flaml.automl.logger: 04-28 02:31:59] {1881} INFO - List of ML learners in AutoML Run: ['lgbm', 'rf', 'catboost', 'xgboost', 'extra_tree', 'xgb_limitdepth', 'lrl1']\n",
"[flaml.automl.logger: 04-28 02:31:59] {2191} INFO - iteration 0, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:59] {2317} INFO - Estimated sufficient time budget=13725s. Estimated necessary time budget=337s.\n",
"[flaml.automl.logger: 04-28 02:31:59] {2364} INFO - at 0.5s,\testimator lgbm's best error=0.6647,\tbest estimator lgbm's best error=0.6647\n",
"[flaml.automl.logger: 04-28 02:31:59] {2191} INFO - iteration 1, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:59] {2364} INFO - at 0.6s,\testimator lgbm's best error=0.6647,\tbest estimator lgbm's best error=0.6647\n",
"[flaml.automl.logger: 04-28 02:31:59] {2191} INFO - iteration 2, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:59] {2364} INFO - at 0.6s,\testimator lgbm's best error=0.6491,\tbest estimator lgbm's best error=0.6491\n",
"[flaml.automl.logger: 04-28 02:31:59] {2191} INFO - iteration 3, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:31:59] {2364} INFO - at 0.7s,\testimator xgboost's best error=0.6672,\tbest estimator lgbm's best error=0.6491\n",
"[flaml.automl.logger: 04-28 02:31:59] {2191} INFO - iteration 4, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:31:59] {2364} INFO - at 0.7s,\testimator lgbm's best error=0.6423,\tbest estimator lgbm's best error=0.6423\n",
"[flaml.automl.logger: 04-28 02:31:59] {2191} INFO - iteration 5, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 0.8s,\testimator lgbm's best error=0.6423,\tbest estimator lgbm's best error=0.6423\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 6, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 0.8s,\testimator lgbm's best error=0.6423,\tbest estimator lgbm's best error=0.6423\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 7, current learner lgbm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 0.9s,\testimator lgbm's best error=0.6400,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 8, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 0.9s,\testimator lgbm's best error=0.6400,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 9, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 0.9s,\testimator xgboost's best error=0.6672,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 10, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.0s,\testimator xgboost's best error=0.6503,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 11, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.0s,\testimator extra_tree's best error=0.6678,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 12, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.1s,\testimator extra_tree's best error=0.6576,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 13, current learner rf\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.1s,\testimator rf's best error=0.6614,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 14, current learner rf\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.2s,\testimator rf's best error=0.6523,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 15, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.3s,\testimator xgboost's best error=0.6428,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 16, current learner rf\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.3s,\testimator rf's best error=0.6523,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 17, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.4s,\testimator extra_tree's best error=0.6576,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 18, current learner lgbm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.4s,\testimator lgbm's best error=0.6400,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 19, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.5s,\testimator xgboost's best error=0.6428,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 20, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.5s,\testimator xgboost's best error=0.6428,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 21, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.6s,\testimator xgboost's best error=0.6428,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 22, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.6s,\testimator lgbm's best error=0.6400,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 23, current learner lgbm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:32:00] {2364} INFO - at 1.7s,\testimator lgbm's best error=0.6400,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:00] {2191} INFO - iteration 24, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:32:01] {2364} INFO - at 1.8s,\testimator xgboost's best error=0.6428,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:01] {2191} INFO - iteration 25, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:32:01] {2364} INFO - at 1.8s,\testimator extra_tree's best error=0.6576,\tbest estimator lgbm's best error=0.6400\n",
"[flaml.automl.logger: 04-28 02:32:01] {2191} INFO - iteration 26, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:01] {2364} INFO - at 1.9s,\testimator lgbm's best error=0.6335,\tbest estimator lgbm's best error=0.6335\n",
"[flaml.automl.logger: 04-28 02:32:01] {2191} INFO - iteration 27, current learner xgboost\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:32:01] {2364} INFO - at 2.0s,\testimator xgboost's best error=0.6423,\tbest estimator lgbm's best error=0.6335\n",
"[flaml.automl.logger: 04-28 02:32:01] {2191} INFO - iteration 28, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:32:01] {2364} INFO - at 2.0s,\testimator extra_tree's best error=0.6480,\tbest estimator lgbm's best error=0.6335\n",
"[flaml.automl.logger: 04-28 02:32:01] {2191} INFO - iteration 29, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:32:01] {2364} INFO - at 2.1s,\testimator extra_tree's best error=0.6480,\tbest estimator lgbm's best error=0.6335\n",
"[flaml.automl.logger: 04-28 02:32:01] {2191} INFO - iteration 30, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:01] {2364} INFO - at 2.2s,\testimator lgbm's best error=0.6335,\tbest estimator lgbm's best error=0.6335\n",
"[flaml.automl.logger: 04-28 02:32:01] {2191} INFO - iteration 31, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:01] {2364} INFO - at 2.2s,\testimator lgbm's best error=0.6335,\tbest estimator lgbm's best error=0.6335\n",
"[flaml.automl.logger: 04-28 02:32:01] {2191} INFO - iteration 32, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:01] {2364} INFO - at 2.3s,\testimator lgbm's best error=0.6335,\tbest estimator lgbm's best error=0.6335\n",
"[flaml.automl.logger: 04-28 02:32:01] {2191} INFO - iteration 33, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:32:01] {2364} INFO - at 2.4s,\testimator extra_tree's best error=0.6480,\tbest estimator lgbm's best error=0.6335\n",
"[flaml.automl.logger: 04-28 02:32:01] {2191} INFO - iteration 34, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:01] {2364} INFO - at 2.5s,\testimator lgbm's best error=0.6335,\tbest estimator lgbm's best error=0.6335\n",
"[flaml.automl.logger: 04-28 02:32:01] {2191} INFO - iteration 35, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:02] {2364} INFO - at 3.0s,\testimator lgbm's best error=0.6328,\tbest estimator lgbm's best error=0.6328\n",
"[flaml.automl.logger: 04-28 02:32:02] {2191} INFO - iteration 36, current learner extra_tree\n",
"[flaml.automl.logger: 04-28 02:32:02] {2364} INFO - at 3.1s,\testimator extra_tree's best error=0.6479,\tbest estimator lgbm's best error=0.6328\n",
"[flaml.automl.logger: 04-28 02:32:02] {2191} INFO - iteration 37, current learner rf\n",
"[flaml.automl.logger: 04-28 02:32:02] {2364} INFO - at 3.1s,\testimator rf's best error=0.6523,\tbest estimator lgbm's best error=0.6328\n",
"[flaml.automl.logger: 04-28 02:32:02] {2191} INFO - iteration 38, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:32:02] {2364} INFO - at 3.3s,\testimator catboost's best error=0.6598,\tbest estimator lgbm's best error=0.6328\n",
"[flaml.automl.logger: 04-28 02:32:02] {2191} INFO - iteration 39, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:32:02] {2364} INFO - at 3.5s,\testimator catboost's best error=0.6598,\tbest estimator lgbm's best error=0.6328\n",
"[flaml.automl.logger: 04-28 02:32:02] {2191} INFO - iteration 40, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:32:02] {2364} INFO - at 3.6s,\testimator catboost's best error=0.6459,\tbest estimator lgbm's best error=0.6328\n",
"[flaml.automl.logger: 04-28 02:32:02] {2191} INFO - iteration 41, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:32:03] {2364} INFO - at 3.8s,\testimator catboost's best error=0.6459,\tbest estimator lgbm's best error=0.6328\n",
"[flaml.automl.logger: 04-28 02:32:03] {2191} INFO - iteration 42, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:32:03] {2364} INFO - at 4.0s,\testimator catboost's best error=0.6459,\tbest estimator lgbm's best error=0.6328\n",
"[flaml.automl.logger: 04-28 02:32:03] {2191} INFO - iteration 43, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:03] {2364} INFO - at 4.4s,\testimator lgbm's best error=0.6241,\tbest estimator lgbm's best error=0.6241\n",
"[flaml.automl.logger: 04-28 02:32:03] {2191} INFO - iteration 44, current learner rf\n",
"[flaml.automl.logger: 04-28 02:32:03] {2364} INFO - at 4.5s,\testimator rf's best error=0.6470,\tbest estimator lgbm's best error=0.6241\n",
"[flaml.automl.logger: 04-28 02:32:03] {2191} INFO - iteration 45, current learner xgboost\n",
"[flaml.automl.logger: 04-28 02:32:03] {2364} INFO - at 4.5s,\testimator xgboost's best error=0.6423,\tbest estimator lgbm's best error=0.6241\n",
"[flaml.automl.logger: 04-28 02:32:03] {2191} INFO - iteration 46, current learner rf\n",
"[flaml.automl.logger: 04-28 02:32:03] {2364} INFO - at 4.6s,\testimator rf's best error=0.6468,\tbest estimator lgbm's best error=0.6241\n",
"[flaml.automl.logger: 04-28 02:32:03] {2191} INFO - iteration 47, current learner lgbm\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:32:04] {2364} INFO - at 5.0s,\testimator lgbm's best error=0.6241,\tbest estimator lgbm's best error=0.6241\n",
"[flaml.automl.logger: 04-28 02:32:04] {2191} INFO - iteration 48, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:04] {2364} INFO - at 5.4s,\testimator lgbm's best error=0.6206,\tbest estimator lgbm's best error=0.6206\n",
"[flaml.automl.logger: 04-28 02:32:04] {2191} INFO - iteration 49, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:05] {2364} INFO - at 5.8s,\testimator lgbm's best error=0.6206,\tbest estimator lgbm's best error=0.6206\n",
"[flaml.automl.logger: 04-28 02:32:05] {2191} INFO - iteration 50, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:05] {2364} INFO - at 6.2s,\testimator lgbm's best error=0.6206,\tbest estimator lgbm's best error=0.6206\n",
"[flaml.automl.logger: 04-28 02:32:05] {2191} INFO - iteration 51, current learner catboost\n",
"[flaml.automl.logger: 04-28 02:32:05] {2364} INFO - at 6.5s,\testimator catboost's best error=0.6459,\tbest estimator lgbm's best error=0.6206\n",
"[flaml.automl.logger: 04-28 02:32:05] {2191} INFO - iteration 52, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:06] {2364} INFO - at 7.1s,\testimator lgbm's best error=0.6185,\tbest estimator lgbm's best error=0.6185\n",
"[flaml.automl.logger: 04-28 02:32:06] {2191} INFO - iteration 53, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:07] {2364} INFO - at 8.0s,\testimator lgbm's best error=0.6156,\tbest estimator lgbm's best error=0.6156\n",
"[flaml.automl.logger: 04-28 02:32:07] {2191} INFO - iteration 54, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:08] {2364} INFO - at 8.8s,\testimator lgbm's best error=0.6156,\tbest estimator lgbm's best error=0.6156\n",
"[flaml.automl.logger: 04-28 02:32:08] {2191} INFO - iteration 55, current learner lgbm\n",
"[flaml.automl.logger: 04-28 02:32:09] {2364} INFO - at 9.8s,\testimator lgbm's best error=0.6156,\tbest estimator lgbm's best error=0.6156\n",
"[flaml.automl.logger: 04-28 02:32:09] {2191} INFO - iteration 56, current learner xgb_limitdepth\n",
"[flaml.automl.logger: 04-28 02:32:09] {2364} INFO - at 9.8s,\testimator xgb_limitdepth's best error=0.6682,\tbest estimator lgbm's best error=0.6156\n",
"[flaml.automl.logger: 04-28 02:32:09] {2191} INFO - iteration 57, current learner xgb_limitdepth\n",
"[flaml.automl.logger: 04-28 02:32:09] {2364} INFO - at 9.9s,\testimator xgb_limitdepth's best error=0.6682,\tbest estimator lgbm's best error=0.6156\n",
"[flaml.automl.logger: 04-28 02:32:09] {2191} INFO - iteration 58, current learner xgb_limitdepth\n",
"[flaml.automl.logger: 04-28 02:32:09] {2364} INFO - at 9.9s,\testimator xgb_limitdepth's best error=0.6542,\tbest estimator lgbm's best error=0.6156\n",
"[flaml.automl.logger: 04-28 02:32:09] {2191} INFO - iteration 59, current learner xgb_limitdepth\n",
"[flaml.automl.logger: 04-28 02:32:09] {2364} INFO - at 10.0s,\testimator xgb_limitdepth's best error=0.6496,\tbest estimator lgbm's best error=0.6156\n",
"[flaml.automl.logger: 04-28 02:32:09] {2191} INFO - iteration 60, current learner lrl1\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n",
"/home/vscode/.local/lib/python3.9/site-packages/xgboost/sklearn.py:1395: UserWarning: `use_label_encoder` is deprecated in 1.7.0.\n",
" warnings.warn(\"`use_label_encoder` is deprecated in 1.7.0.\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:32:09] {2364} INFO - at 10.1s,\testimator lrl1's best error=0.6817,\tbest estimator lgbm's best error=0.6156\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python3.9/site-packages/sklearn/linear_model/_sag.py:350: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge\n",
" warnings.warn(\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[flaml.automl.logger: 04-28 02:32:10] {2600} INFO - retrain lgbm for 0.7s\n",
"[flaml.automl.logger: 04-28 02:32:10] {2603} INFO - retrained model: LGBMClassifier(colsample_bytree=0.9031374907114736,\n",
" learning_rate=0.3525398690474661, max_bin=1023,\n",
" min_child_samples=4, n_estimators=22, num_leaves=69,\n",
" reg_alpha=0.0060777294606297145, reg_lambda=37.65858370595088,\n",
" verbose=-1)\n",
"[flaml.automl.logger: 04-28 02:32:10] {1911} INFO - fit succeeded\n",
"[flaml.automl.logger: 04-28 02:32:10] {1912} INFO - Time taken to find the best model: 8.02491545677185\n"
]
}
],
"source": [
"automl = AutoML()\n",
"settings = {\n",
" \"time_budget\": 10, # total running time in seconds\n",
" \"metric\": custom_metric, # pass the custom metric funtion here\n",
" \"task\": 'classification', # task type\n",
" \"log_file_name\": 'airlines_experiment_custom_metric.log', # flaml log file\n",
"}\n",
"\n",
"automl.fit(X_train=X_train, y_train=y_train, **settings)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.15 64-bit",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.15"
},
"vscode": {
"interpreter": {
"hash": "949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}