Skip to content

Commit

Permalink
Use history.get_fvals method
Browse files Browse the repository at this point in the history
  • Loading branch information
timmens committed Jan 21, 2024
1 parent 5674335 commit e3c1ac2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/tranquilo/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,8 @@ def get_best(self):
which is a mean if there are multiple evaluations per x, and the index.
"""
average_fvals = {
x_index: np.mean(self.fvals[f_indices])
for x_index, f_indices in self.index_mapper.items()
}
fvals = self.get_fvals(np.arange(self.n_xs))
average_fvals = {key: np.mean(val) for key, val in fvals.items()}
index = pd.Series(average_fvals).idxmin()
return self.get_xs(index), average_fvals[index], index

Expand Down

0 comments on commit e3c1ac2

Please sign in to comment.