Skip to content

Commit

Permalink
Remove unused ModelBridge._extend_training_data (#2678)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2678

This method has no usage or tests associated with it.

Reviewed By: Balandat

Differential Revision: D61541542

fbshipit-source-id: d476a2c67165dccc85496ce5d5157ea2d46ce0ce
  • Loading branch information
saitcakmak authored and facebook-github-bot committed Aug 20, 2024
1 parent 6ac3aae commit 6e7e798
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions ax/modelbridge/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,36 +336,6 @@ def _set_training_data(
observations=observations,
)

def _extend_training_data(
self, observations: list[Observation]
) -> list[Observation]:
"""Extend and return training data, not-transformed.
If the modelbridge specifies _fit_out_of_design, all training data is
returned. Otherwise, only in design points are returned.
Args:
observations: New observations.
Returns: New + old observations.
"""
observations = self._prepare_training_data(observations=observations)
for obs in observations:
for metric_name in obs.data.metric_names:
if metric_name not in self._metric_names:
raise ValueError(
f"Unrecognised metric {metric_name}; cannot update "
"training data with metrics that were not in the original "
"training data."
)
# Initialize with all points in design.
self._training_data.extend(deepcopy(observations))
all_observations = self.get_training_data()
return self._process_in_design(
search_space=self._model_space,
observations=all_observations,
)

def _process_in_design(
self,
search_space: SearchSpace,
Expand Down

0 comments on commit 6e7e798

Please sign in to comment.