Skip to content
Open

Test HV #1227

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions vizier/_src/benchmarks/analyzers/convergence_curve_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def test_convert_with_origin_reference(self):
pytrials = []
pytrials.append(
pyvizier.Trial().complete(
pyvizier.Measurement(metrics={'max': 4.0, 'min': 2.0})
pyvizier.Measurement(metrics={'max': 4.0, 'min': 0.0})
)
)
pytrials.append(
Expand All @@ -288,15 +288,16 @@ def test_convert_with_origin_reference(self):
)
pytrials.append(
pyvizier.Trial().complete(
pyvizier.Measurement(metrics={'max': 4.0, 'min': -2.0})
pyvizier.Measurement(metrics={'max': 2.0, 'min': -2.0})
)
)

curve = generator.convert(pytrials)
# With the sign of the minization metric flipped, the three metric points
# are (4, 0), (3, 1), (2, 2). The origin (i.e., reference point) is (0, 0).
# The sequence of hypervolumes is expected to be (0, 3.5, 6).
np.testing.assert_array_equal(curve.xs, [1, 2, 3])
np.testing.assert_array_almost_equal(
curve.ys, [[0.0, 3.0, 8.0]], decimal=0.5
)
np.testing.assert_array_almost_equal(curve.ys, [[0.0, 3.5, 6.0]], decimal=1)

def test_convert_with_reference(self):
generator = convergence.HypervolumeCurveConverter(
Expand Down
Loading