Skip to content

Commit

Permalink
Fix handling of pending experiments in naive recommender
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSosic committed Jan 23, 2025
1 parent 4dc4f2f commit 4034b83
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions baybe/recommenders/naive.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ def recommend(
) -> pd.DataFrame:
from baybe.acquisition.partial import PartialAcquisitionFunction

if (not isinstance(self.disc_recommender, BayesianRecommender)) and (
not isinstance(self.disc_recommender, NonPredictiveRecommender)
disc_is_bayesian = isinstance(self.disc_recommender, BayesianRecommender)
if not disc_is_bayesian and not isinstance(
self.disc_recommender, NonPredictiveRecommender
):
raise NotImplementedError(
"""The discrete recommender should be either a Bayesian or a
Expand All @@ -79,7 +80,7 @@ def recommend(
searchspace=searchspace,
objective=objective,
measurements=measurements,
pending_experiments=pending_experiments,
pending_experiments=pending_experiments if disc_is_bayesian else None,
)

# We are in a hybrid setting now
Expand Down

0 comments on commit 4034b83

Please sign in to comment.