{
"cells": [
{
"cell_type": "markdown",
"id": "12ada6c3",
"metadata": {},
"source": [
"(tune-lightgbm-example)=\n",
"\n",
"# Using LightGBM with Tune\n",
"\n",
"```{image} /images/lightgbm_logo.png\n",
":align: center\n",
":alt: LightGBM Logo\n",
":height: 120px\n",
":target: https://lightgbm.readthedocs.io\n",
"```\n",
"\n",
"```{contents}\n",
":backlinks: none\n",
":local: true\n",
"```\n",
"\n",
"## Example"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "b4c3f1e1",
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2022-07-22 15:30:02,623\tINFO services.py:1483 -- View the Ray dashboard at \u001b[1m\u001b[32mhttp://127.0.0.1:8265\u001b[39m\u001b[22m\n",
"2022-07-22 15:30:05,042\tWARNING function_trainable.py:619 -- Function checkpointing is disabled. This may result in unexpected behavior when using checkpointing features or certain schedulers. To enable, set the train function arguments to be `func(config, checkpoint_dir=None)`.\n"
]
},
{
"data": {
"text/html": [
"== Status ==
Current time: 2022-07-22 15:30:18 (running for 00:00:12.88)
Memory usage on this node: 10.1/16.0 GiB
Using AsyncHyperBand: num_stopped=4\n",
"Bracket: Iter 64.000: -0.32867132867132864 | Iter 16.000: -0.32867132867132864 | Iter 4.000: -0.32867132867132864 | Iter 1.000: -0.35664335664335667
Resources requested: 0/16 CPUs, 0/0 GPUs, 0.0/5.3 GiB heap, 0.0/2.0 GiB objects
Current best trial: c7534_00003 with binary_error=0.3146853146853147 and parameters={'objective': 'binary', 'metric': ['binary_error', 'binary_logloss'], 'verbose': -1, 'boosting_type': 'dart', 'num_leaves': 702, 'learning_rate': 4.858514533326432e-08}
Result logdir: /Users/kai/ray_results/train_breast_cancer_2022-07-22_15-29-59
Number of trials: 4/4 (4 TERMINATED)
Trial name | status | loc | boosting_type | learning_rate | num_leaves | iter | total time (s) | binary_error | binary_logloss |
---|---|---|---|---|---|---|---|---|---|
train_breast_cancer_c7534_00000 | TERMINATED | 127.0.0.1:46947 | gbdt | 1.09528e-08 | 926 | 100 | 4.04621 | 0.370629 | 0.659303 |
train_breast_cancer_c7534_00001 | TERMINATED | 127.0.0.1:46965 | dart | 9.07058e-05 | 512 | 1 | 0.0379331 | 0.391608 | 0.670769 |
train_breast_cancer_c7534_00002 | TERMINATED | 127.0.0.1:46987 | gbdt | 0.00110605 | 186 | 1 | 0.0196211 | 0.405594 | 0.678443 |
train_breast_cancer_c7534_00003 | TERMINATED | 127.0.0.1:46988 | dart | 4.85851e-08 | 702 | 100 | 0.417179 | 0.314685 | 0.655626 |