예제 #1
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
예제 #2
0
def check_high_perf():
    length = 40
    concept_class = MonotoneConjunction(length)
    perf = PerformanceOracleWithTolerance(concept_class, 0)

    highest_perf_except_for_1 = 0
    for i in xrange(10000000):
        rep = tuple([choice([0, 1]) for _ in xrange(length)])

        current_perf = perf.get_estimated_performance(rep)

        if current_perf != 1:
            highest_perf_except_for_1 = max(highest_perf_except_for_1, current_perf)

    print highest_perf_except_for_1
 def setUp(self):
     self.tolerance_param = 0.00001
     self.concept_class = Mock()
     self.perf = PerformanceOracleWithTolerance(self.concept_class,
                                                self.tolerance_param)
 def get_perf_without_precomp(self, concept_class):
     return PerformanceOracleWithTolerance(concept_class, self.tau)