def assert_estimation(self, tp, tn, fp, fn, total, positives, negatives, fitness):
     assert_that(self.sut.true_positive, is_(equal_to(tp)))
     assert_that(self.sut.true_negative, is_(equal_to(tn)))
     assert_that(self.sut.false_positive, is_(equal_to(fp)))
     assert_that(self.sut.false_negative, is_(equal_to(fn)))
     assert_that(self.sut.total, is_(equal_to(total)))
     assert_that(self.sut.positives_that_has_occurred, is_(equal_to(positives)))
     assert_that(self.sut.negatives_that_has_occurred, is_(equal_to(negatives)))
     assert_nearly_equal_or_both_nan(self.sut.fitness, fitness)
 def assert_estimation(self, n_success, n_evals, s, min_evals):
     assert_that(self.sut.n_success, is_(equal_to(n_success)))
     assert_nearly_equal_or_both_nan(self.sut.n_evals, n_evals)
     assert_nearly_equal_or_both_nan(self.sut.s, s)
     assert_nearly_equal_or_both_nan(self.sut.min_evals, min_evals)
    def assert_estimation(self, step, fitness, miss_rate, fallout, sensitivity, specificity,
                          accuracy,
                          min_fitness, max_fitness, min_miss_rate, max_miss_rate,
                          min_fallout, max_fallout, min_sensitivity, max_sensitivity,
                          min_specificity, max_specificity, min_accuracy, max_accuracy,
                          average_fitness, average_miss_rate, average_fallout, average_sensitivity,
                          average_specificity, average_accuracy, global_min_fitness,
                          global_min_miss_rate, global_min_fallout, global_min_sensitivity,
                          global_min_specificity, global_min_accuracy, global_max_fitness,
                          global_max_miss_rate, global_max_fallout, global_max_sensitivity,
                          global_max_specificity, global_max_accuracy, estimator=None):
        fit = 'fitness'
        mis = 'missrate'
        fal = 'fallout'
        sen = 'sensitivity'
        spe = 'specificity'
        acc = 'accuracy'

        estimator = estimator if estimator is not None else self.sut

        assert_nearly_equal_or_both_nan(estimator[fit].get(step), fitness)
        assert_nearly_equal_or_both_nan(estimator[mis].get(step), miss_rate)
        assert_nearly_equal_or_both_nan(estimator[fal].get(step), fallout)
        assert_nearly_equal_or_both_nan(estimator[sen].get(step), sensitivity)
        assert_nearly_equal_or_both_nan(estimator[spe].get(step), specificity)
        assert_nearly_equal_or_both_nan(estimator[acc].get(step), accuracy)
        
        assert_nearly_equal_or_both_nan(estimator[fit].get_min(step), min_fitness)
        assert_nearly_equal_or_both_nan(estimator[fit].get_max(step), max_fitness)

        assert_nearly_equal_or_both_nan(estimator[mis].get_min(step), min_miss_rate)
        assert_nearly_equal_or_both_nan(estimator[mis].get_max(step), max_miss_rate)

        assert_nearly_equal_or_both_nan(estimator[fal].get_min(step), min_fallout)
        assert_nearly_equal_or_both_nan(estimator[fal].get_max(step), max_fallout)

        assert_nearly_equal_or_both_nan(estimator[sen].get_min(step), min_sensitivity)
        assert_nearly_equal_or_both_nan(estimator[sen].get_max(step), max_sensitivity)

        assert_nearly_equal_or_both_nan(estimator[spe].get_min(step), min_specificity)
        assert_nearly_equal_or_both_nan(estimator[spe].get_max(step), max_specificity)

        assert_nearly_equal_or_both_nan(estimator[acc].get_min(step), min_accuracy)
        assert_nearly_equal_or_both_nan(estimator[acc].get_max(step), max_accuracy)
        
        assert_nearly_equal_or_both_nan(estimator[fit].get_global_average(), average_fitness)
        assert_nearly_equal_or_both_nan(estimator[mis].get_global_average(), average_miss_rate)
        assert_nearly_equal_or_both_nan(estimator[fal].get_global_average(), average_fallout)
        assert_nearly_equal_or_both_nan(estimator[sen].get_global_average(), average_sensitivity)
        assert_nearly_equal_or_both_nan(estimator[spe].get_global_average(), average_specificity)
        assert_nearly_equal_or_both_nan(estimator[acc].get_global_average(), average_accuracy)
        
        assert_nearly_equal_or_both_nan(estimator[fit].get_global_min(), global_min_fitness)
        assert_nearly_equal_or_both_nan(estimator[mis].get_global_min(), global_min_miss_rate)
        assert_nearly_equal_or_both_nan(estimator[fal].get_global_min(), global_min_fallout)
        assert_nearly_equal_or_both_nan(estimator[sen].get_global_min(), global_min_sensitivity)
        assert_nearly_equal_or_both_nan(estimator[spe].get_global_min(), global_min_specificity)
        assert_nearly_equal_or_both_nan(estimator[acc].get_global_min(), global_min_accuracy)

        assert_nearly_equal_or_both_nan(estimator[fit].get_global_max(), global_max_fitness)
        assert_nearly_equal_or_both_nan(estimator[mis].get_global_max(), global_max_miss_rate)
        assert_nearly_equal_or_both_nan(estimator[fal].get_global_max(), global_max_fallout)
        assert_nearly_equal_or_both_nan(estimator[sen].get_global_max(), global_max_sensitivity)
        assert_nearly_equal_or_both_nan(estimator[spe].get_global_max(), global_max_specificity)
        assert_nearly_equal_or_both_nan(estimator[acc].get_global_max(), global_max_accuracy)