Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wesk committed Sep 11, 2023
1 parent 57efa0e commit 7b4a3c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
16 changes: 5 additions & 11 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import os
import shutil
import sys
from pathlib import Path

import syne_tune

Expand All @@ -23,17 +24,10 @@

def copy_notebooks_into_docs_folder(app):
# .ipynb files must be inside the docs/ folder for Jupyter to be able to convert them
currpath = os.path.dirname(os.path.realpath(__file__))
source = os.path.join(currpath, "../../examples/notebooks")
destination = os.path.join(currpath, "notebooks")
print(
f"current path: {currpath}; source path: {source}; destination path: {destination}"
)
try:
shutil.rmtree(destination)
except OSError as e:
print("Error: %s - %s." % (e.filename, e.strerror))
shutil.copytree(source, destination)
source = Path(__file__).parent.parent.parent / "examples" / "notebooks"
destination = Path(__file__).parent / "notebooks"
print(f"Jupyter notebook source path: {source}; destination path: {destination}")
shutil.copytree(source, destination, dirs_exist_ok=True)


def run_apidoc(app):
Expand Down
7 changes: 2 additions & 5 deletions examples/notebooks/tune_xgboost.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"source": [
"from syne_tune import Tuner, StoppingCriterion\n",
"from syne_tune.backend import PythonBackend\n",
"from syne_tune.config_space import randint, uniform\n",
"from syne_tune.config_space import randint, uniform, loguniform\n",
"from syne_tune.optimizer.baselines import BayesianOptimization\n",
"from syne_tune.experiments import load_experiment"
]
Expand Down Expand Up @@ -72,8 +72,6 @@
" import xgboost\n",
" import numpy as np\n",
"\n",
" eval_metric = \"merror\"\n",
"\n",
" X, y = load_digits(return_X_y=True)\n",
"\n",
" X_trainval, X_test, y_trainval, y_test = train_test_split(X, y, test_size=0.2, random_state=42)\n",
Expand All @@ -86,7 +84,6 @@
" reg_lambda=reg_lambda,\n",
" gamma=gamma,\n",
" max_depth=max_depth,\n",
" eval_metric=eval_metric,\n",
" )\n",
" clf.fit(X_train, y_train, eval_set=[(X_val, y_val)])\n",
"\n",
Expand Down Expand Up @@ -114,7 +111,7 @@
"config_space = {\n",
" \"max_depth\": randint(1,10),\n",
" \"gamma\": uniform(1,10),\n",
" \"reg_lambda\": uniform(.0000001, 1),\n",
" \"reg_lambda\": loguniform(.0000001, 1),\n",
" \"n_estimators\": randint(5, 15)\n",
"}\n",
"\n",
Expand Down

0 comments on commit 7b4a3c2

Please sign in to comment.