Esempio n. 1
0
    def test_get_identifiers_from_run_history_log_loss(self):
        ensemble = SingleBest(
            metric=log_loss,
            random_state=1,
            run_history=self.run_history,
        )

        # Just one model
        self.assertEqual(len(ensemble.identifiers_), 1)

        # That model must be the best
        seed, num_run, budget = ensemble.identifiers_[0]
        self.assertEqual(num_run, 3)
        self.assertEqual(seed, 1)
        self.assertEqual(budget, 3.0)
Esempio n. 2
0
def test_get_identifiers_from_run_history(exists, metric, ensemble_run_history,
                                          ensemble_backend):
    exists.return_value = True
    ensemble = SingleBest(
        metric=log_loss,
        seed=1,
        run_history=ensemble_run_history,
        backend=ensemble_backend,
    )

    # Just one model
    assert len(ensemble.identifiers_) == 1

    # That model must be the best
    seed, num_run, budget = ensemble.identifiers_[0]
    assert num_run == 3
    assert seed == 1
    assert budget == 3.0