MCPcopy Create free account
hub / github.com/modAL-python/modAL / test_get_max

Method test_get_max

tests/core_tests.py:1297–1309  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1295 np.testing.assert_equal(y_new[max_idx], learner.y_max)
1296
1297 def test_get_max(self):
1298 for n_samples in range(1, 100):
1299 for max_idx in range(0, n_samples):
1300 X = np.random.rand(n_samples, 3)
1301 y = np.random.rand(n_samples)
1302 y[max_idx] = 10
1303
1304 regressor = mock.MockEstimator()
1305 optimizer = modAL.models.learners.BayesianOptimizer(
1306 regressor, X_training=X, y_training=y)
1307 X_max, y_max = optimizer.get_max()
1308 np.testing.assert_equal(X_max, X[max_idx])
1309 np.testing.assert_equal(y_max, y[max_idx])
1310
1311 def test_teach(self):
1312 for bootstrap, only_new in product([True, False], [True, False]):

Callers

nothing calls this directly

Calls 1

get_maxMethod · 0.95

Tested by

no test coverage detected