MCPcopy Create free account
hub / github.com/Kaggle/docker-python / test_study

Method test_study

tests/test_optuna.py:8–17  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6class TestOptuna(unittest.TestCase):
7
8 def test_study(self):
9
10 def objective(trial):
11 x = trial.suggest_uniform('x', -1., 1.)
12 return x ** 2
13
14 n_trials = 20
15 study = optuna.create_study()
16 study.optimize(objective, n_trials=n_trials)
17 self.assertEqual(len(study.trials), n_trials)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected