Skip to content

Conversation

@nabenabe0928
Copy link
Contributor

Contributor Agreements

Please read the contributor agreements and if you agree, please click the checkbox below.

  • I agree to the contributor agreements.

@nabenabe0928 nabenabe0928 changed the title Refactor value at risk Refactor value at risk and add get robust trial API Sep 18, 2025
@nabenabe0928 nabenabe0928 changed the title Refactor value at risk and add get robust trial API Refactor value at risk and add get_robust_trial API Sep 18, 2025
Comment on lines 381 to 382
_sign = np.array([-1.0 if d == StudyDirection.MINIMIZE else 1.0 for d in study.directions])
y_train, _, _ = _standardize_values(_sign * np.array([trial.values for trial in trials]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why an underscore (_) is prefixed in the variable _sign?

Local variables starting with an underscore are usually used when the variables are never read, but here the _sign variable is read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thank you for the comments:)
I modified accordingly!

Copy link
Contributor

@msakai msakai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_robust_trial looks good to me.

@y0z y0z merged commit 7b65827 into optuna:main Oct 1, 2025
3 checks passed
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.

3 participants