Skip to content

add understandable error message for direction in multi-objective opt…#6022

Closed
sinano1107 wants to merge 1 commit intooptuna:masterfrom
sinano1107:main
Closed

add understandable error message for direction in multi-objective opt…#6022
sinano1107 wants to merge 1 commit intooptuna:masterfrom
sinano1107:main

Conversation

@sinano1107
Copy link
Copy Markdown
Contributor

This PR is a new one to work around this #6021 Check issue.

issue: #5806

Motivation

Users sometimes makes the mistake of passing the list of directions to the direction argument. The error message for this mistake is hard to understand what is the problem.

  • Correct
optuna.create_study(directions=["minimize", "minimize"])
  • Wrong

Using direction instead of directions

optuna.create_study(direction=["minimize", "minimize"])
ValueError: Please set either 'minimize' or 'maximize' to direction. You can also set the corresponding `StudyDirection` member.

Description of the changes

The error message displayed when a list object, is assigned to the direction parameter of create_study has been changed as follows.

  • previous
ValueError: Please set either 'minimize' or 'maximize' to direction. You can also set the corresponding `StudyDirection` member.
  • new
ValueError: For multi-objective optimization, using `directions` instead of `direction`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant