Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the simplest example directly to README #215

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@ Optuna Examples

This page contains a list of example codes written with Optuna.

The simplest codeblock looks like this:

```python
import optuna


def objective(trial):
x = trial.suggest_float("x", -100, 100)
return x ** 2


if __name__ == "__main__":
study = optuna.create_study()
# The optimization finishes after evaluating 1000 times or 3 seconds.
study.optimize(objective, n_trials=1000, timeout=3)
print(f"Best params is {study.best_params} with value {study.best_value}")
```

The examples below provide codeblocks similar to the example above for various different scenarios.

### Simple Black-box Optimization

* [Quadratic function](./quadratic_simple.py)
Expand Down