Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Separate cluster creation from training in Optuna example #3

Merged
merged 1 commit into from Oct 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 32 additions & 8 deletions optuna-xgboost/optuna-xgboost.ipynb
Expand Up @@ -68,25 +68,49 @@
" return accuracy"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Connect to Coiled"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from dask.distributed import Client\n",
"import coiled\n",
"import optuna\n",
"import dask_optuna\n",
"import joblib\n",
"from dask.distributed import Client\n",
"\n",
"# Create a Dask cluster with Coiled\n",
"cluster = coiled.Cluster(n_workers=10, software=\"jrbourbeau/optuna\")\n",
"# Connect Dask to our cluster\n",
"cluster = coiled.Cluster(\n",
" n_workers=10, \n",
" software=\"jrbourbeau/optuna\"\n",
")\n",
"client = Client(cluster)\n",
"print(f\"Dask dashboard is available at {client.dashboard_link}\")\n",
"client.wait_for_workers(10)\n",
"\n",
"client"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Train with Optuna"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import optuna\n",
"import dask_optuna\n",
"import joblib\n",
"\n",
"# Create Dask-compatible Optuna storage class\n",
"storage = dask_optuna.DaskStorage()\n",
"\n",
Expand Down