Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
y0z committed Feb 15, 2024
1 parent a415c1a commit 4ce4c6c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 35 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/sphinx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install -U pip
pip install git+https://github.com/optuna/optuna-integration@main
pip install --progress-bar off -U .[document] --extra-index-url https://download.pytorch.org/whl/cpu
- name: Output installed packages
Expand Down Expand Up @@ -92,7 +91,6 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install -U pip
pip install git+https://github.com/optuna/optuna-integration@main
pip install --progress-bar off -U .[document] --extra-index-url https://download.pytorch.org/whl/cpu
- name: Output installed packages
Expand Down
3 changes: 0 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
post_install:
- pip install git+https://github.com/optuna/optuna-integration@main

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ def objective(trial):
# For example, `optuna_integration.LightGBMPruningCallback <https://optuna-integration.readthedocs.io/en/stable/reference/generated/optuna_integration.LightGBMPruningCallback.html>`_ introduces pruning without directly changing the logic of training iteration.
# (See also `example <https://github.com/optuna/optuna-examples/blob/main/lightgbm/lightgbm_integration.py>`_ for the entire script.)
#
# .. code-block:: python
# .. code-block:: text
#
# import optuna_integration
# import optuna.integration
#
# pruning_callback = optuna_integration.LightGBMPruningCallback(trial, 'validation-error')
# pruning_callback = optuna.integration.LightGBMPruningCallback(trial, 'validation-error')
# gbm = lgb.train(param, dtrain, valid_sets=[dvalid], callbacks=[pruning_callback])
24 changes: 1 addition & 23 deletions tutorial/10_key_features/005_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
from optuna.visualization import plot_slice
from optuna.visualization import plot_timeline

import optuna_integration


SEED = 42

Expand All @@ -80,8 +78,7 @@ def objective(trial):
}

# Add a callback for pruning.
pruning_callback = optuna_integration.LightGBMPruningCallback(trial, "auc")
gbm = lgb.train(param, dtrain, valid_sets=[dvalid], callbacks=[pruning_callback])
gbm = lgb.train(param, dtrain, valid_sets=[dvalid])

preds = gbm.predict(valid_x)
pred_labels = np.rint(preds)
Expand All @@ -103,10 +100,6 @@ def objective(trial):
# Visualize the optimization history. See :func:`~optuna.visualization.plot_optimization_history` for the details.
plot_optimization_history(study)

###################################################################################################
# Visualize the learning curves of the trials. See :func:`~optuna.visualization.plot_intermediate_values` for the details.
plot_intermediate_values(study)

###################################################################################################
# Visualize high-dimensional parameter relationships. See :func:`~optuna.visualization.plot_parallel_coordinate` for the details.
plot_parallel_coordinate(study)
Expand Down Expand Up @@ -152,18 +145,3 @@ def objective(trial):
###################################################################################################
# Visualize the optimization timeline of performed trials. See :func:`~optuna.visualization.plot_timeline` for the details.
plot_timeline(study)

###################################################################################################
# Customize generated figures
# ---------------------------
# In :mod:`optuna.visualization` and :mod:`optuna.visualization.matplotlib`, a function returns an editable figure object:
# :class:`plotly.graph_objects.Figure` or :class:`matplotlib.axes.Axes` depending on the module.
# This allows users to modify the generated figure for their demand by using API of the visualization library.
# The following example replaces figure titles drawn by Plotly-based :func:`~optuna.visualization.plot_intermediate_values` manually.
fig = plot_intermediate_values(study)

fig.update_layout(
title="Hyperparameter optimization for GBDT-based binary classification",
xaxis_title="Iteration",
yaxis_title="Validation AUC",
)
5 changes: 1 addition & 4 deletions tutorial/20_recipes/008_specify_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@

import optuna

import optuna_integration


###################################################################################################
# Define the objective function.
Expand All @@ -59,8 +57,7 @@ def objective(trial):
}

# Add a callback for pruning.
pruning_callback = optuna_integration.LightGBMPruningCallback(trial, "auc")
gbm = lgb.train(param, dtrain, valid_sets=[dvalid], callbacks=[pruning_callback])
gbm = lgb.train(param, dtrain, valid_sets=[dvalid])

preds = gbm.predict(valid_x)
pred_labels = np.rint(preds)
Expand Down

0 comments on commit 4ce4c6c

Please sign in to comment.