Example #1
0
 def testUpdate(self, mock_init):
     sq_feat = ObservationFeatures({})
     sq_data = self.observation_data[0]
     ma = DiscreteModelBridge()
     ma._training_data = self.observations
     model = mock.create_autospec(DiscreteModel, instance=True)
     ma._fit(model, self.search_space, self.observation_features,
             self.observation_data)
     ma._update([sq_feat], [sq_data])
     self.assertEqual(ma.parameters, ["x", "y", "z"])
     self.assertEqual(sorted(ma.outcomes), ["a", "b"])
     self.assertEqual(ma.training_in_design, [True, True, True, False])
Example #2
0
 def testUpdate(self, mock_init):
     ma = DiscreteModelBridge()
     ma._training_data = self.observations
     model = mock.create_autospec(DiscreteModel, instance=True)
     ma._fit(model, self.search_space, self.observation_features,
             self.observation_data)
     new_feat = ObservationFeatures(parameters={
         "x": 0,
         "y": "bar",
         "z": True
     })
     new_data = ObservationData(metric_names=["a"],
                                means=np.array([3.0]),
                                covariance=np.array([[3.0]]))
     ma._update([new_feat], [new_data])
     self.assertEqual(ma.parameters, ["x", "y", "z"])
     self.assertEqual(sorted(ma.outcomes), ["a", "b"])