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

Bug when batch size exceeds number of candidates #369

Open
AdrianSosic opened this issue Sep 5, 2024 · 1 comment
Open

Bug when batch size exceeds number of candidates #369

AdrianSosic opened this issue Sep 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@AdrianSosic
Copy link
Collaborator

AdrianSosic commented Sep 5, 2024

When setting allow_repeated_recommendations=True it is perfectly valid to request more recommendations than there are candidates in the search space. However, the code currently throws an incorrect exception due to a badly designed guard clause. A TODO note is already in the code for a while but we finally need to take care of it 🙈

from baybe.parameters import NumericalDiscreteParameter
from baybe.recommenders import RandomRecommender

searchspace = NumericalDiscreteParameter("p", [0, 1]).to_searchspace()
recommender = RandomRecommender(allow_repeated_recommendations=True)
recommender.recommend(5, searchspace)
baybe.exceptions.NotEnoughPointsLeftError: Using the current settings, there are fewer than 5 possible data points left to recommend. This can be either because all data points have been measured at some point (while 'allow_repeated_recommendations' or 'allow_recommending_already_measured' being False) or because all data points are marked as 'dont_recommend'.
@AdrianSosic AdrianSosic added the bug Something isn't working label Sep 5, 2024
@Scienfitz
Copy link
Collaborator

Scienfitz commented Sep 10, 2024

I think two types of fixes are required for this

  • make the candidate creation respect that and not throw the NotEnoughCandidatesError
  • all recommenders need to respect the situation where more points are requested than are available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants