def test_adding_new_trials(self): new_arm = get_arms()[1] new_trial = self.experiment.new_trial(generator_run=GeneratorRun( arms=[new_arm])) with self.assertRaises(ValueError): self.experiment.new_trial(generator_run=GeneratorRun( arms=get_arms())) self.assertEqual(new_trial.arms_by_name["1_0"], new_arm) with self.assertRaises(KeyError): self.trial.arms_by_name["1_0"]
def setUp(self): self.experiment = get_experiment() self.experiment.status_quo = None self.batch = self.experiment.new_batch_trial() arms = get_arms() weights = get_weights() self.status_quo = arms[0] self.sq_weight = weights[0] self.arms = arms[1:] self.weights = weights[1:] self.batch.add_arms_and_weights(arms=self.arms, weights=self.weights)
def setUp(self): self.model_predictions = get_model_predictions() self.optimization_config = get_optimization_config() self.search_space = get_search_space() self.arms = get_arms() self.weights = [2, 1, 1] self.unweighted_run = GeneratorRun( arms=self.arms, optimization_config=self.optimization_config, search_space=self.search_space, model_predictions=self.model_predictions, fit_time=4.0, gen_time=10.0, ) self.weighted_run = GeneratorRun( arms=self.arms, weights=self.weights, optimization_config=self.optimization_config, search_space=self.search_space, model_predictions=self.model_predictions, )
def setUp(self): self.experiment = get_experiment() self.trial = self.experiment.new_trial() self.arm = get_arms()[0] self.trial.add_arm(self.arm)