Exemple #1
0
    def setUp(self):
        self.concept_class = Mock()
        self.representation_class = [(0, 1, 1)]
        selection_size = 5

        self.performance_oracle = PerformanceOracle(self.concept_class,
                                                    self.representation_class,
                                                    selection_size)
Exemple #2
0
def test_performance_with_tolerance(length):
    concept_class = MonotoneConjunction(length)

    performance = PerformanceOracle(concept_class, 100)
    performance_with_tolerance = PerformanceOracleWithTolerance(
        concept_class, 0)

    random_func = tuple([choice([0, 1]) for _ in xrange(length)])
    print performance.get_estimated_performance(random_func)
    print performance_with_tolerance.get_estimated_performance(random_func)
    print