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

Change recommend to raise an error in MOO case #1213

Merged
merged 17 commits into from
Aug 23, 2021
Merged

Change recommend to raise an error in MOO case #1213

merged 17 commits into from
Aug 23, 2021

Conversation

theoajc
Copy link
Contributor

@theoajc theoajc commented Aug 18, 2021

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Motivation and Context / Related issue

Make recommend raise an error when doing MOO because during MOO there is no best candidate to recommend so not appropriate.

How Has This Been Tested (if it applies)

Ensure all tests that this change broke passed by making small changes elsewhere when necessary (i.e. to minimize).

Checklist

  • The documentation is up-to-date with the changes I made.
  • I have read the CONTRIBUTING document and completed the CLA (see CLA).
  • All tests passed, and additional code has been covered with new tests.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 18, 2021
@theoajc theoajc changed the title Update recoms [DRAFT] Change recommend to raise an error in MOO case Aug 18, 2021
@theoajc theoajc marked this pull request as ready for review August 18, 2021 14:23
@theoajc theoajc changed the title [DRAFT] Change recommend to raise an error in MOO case Change recommend to raise an error in MOO case Aug 18, 2021
@@ -518,6 +518,8 @@ def recommend(self) -> p.Parameter:
The candidate with minimal loss. :code:`p.Parameters` have field :code:`args` and :code:`kwargs` which can be directly used
on the function (:code:`objective_function(*candidate.args, **candidate.kwargs)`).
"""
if self.num_objectives > 1:
raise RuntimeError("No best candidate in MOO.")
Copy link
Contributor

Choose a reason for hiding this comment

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

might be helpful to tell the user to use the pareto_front function instead, so that they dont get lost

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"No best candidate in MOO. Use pareto_front function instead to get the set of all non-dominated candidates."
How is that?

Co-authored-by: Jérémy Rapin <jrapin.github@gmail.com>
@theoajc theoajc merged commit 46e2ba7 into master Aug 23, 2021
@theoajc theoajc deleted the update_recoms branch August 23, 2021 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants