Beispiel #1
0
    
        if thisFail:
            fail=True
            print "test %d failed!" % t
        else:
            print "test %d passed" % t
    if fail:
        print "FAILED!"
    else:
        print "PASSED!"

    return fail



e1=evidence.entropies
e2=evidence.entropiesFast

def testFunc(case):
    return  testEntropyFunc(e1,e2,case.likelihoodObj,case.likelihoodObj,case.falsePos,case.falseNeg,case.maxCount,case.randomDag)    


testCases.runTests(testFunc,testCases.entropyTestCases)



    
    


Beispiel #2
0
            wrong.append(guess)

        # if((k+1)%10 == 0):
        print "test ", k, " right%=", 100.0 * right / (k + 1), "right=", loc == guess, "totallooks=", totalLooks / (
            k + 1
        ), "looks=", finder.total, "rate=", rate

        # if((k+1)%100 ==0):
        #   tester.printLocs()

    print "right:", right, " out of", trials, tests / trials
    return (float(right) / trials) < cert


def testFunc(case):
    print "testing ", case.likelihoodObj.name(), "randomDag=", case.randomDag

    return testChop(case.likelihoodObj, case.randomDag, case.falseNeg, case.multi)


testCases.runTests(testFunc, testCases.BBChopTestCases)


## for testing a specific case:
if 0:
    import copy

    myCase = copy.copy(testCases.single)
    myCase.randomDag = True
    testFunc(myCase)
Beispiel #3
0
        else:
            wrong.append(guess)

        #if((k+1)%10 == 0):
        print "test ", k, " right%=", 100.0 * right / (
            k + 1), "right=", loc == guess, "totallooks=", totalLooks / (
                k + 1), "looks=", finder.total, "rate=", rate

        #if((k+1)%100 ==0):
        #   tester.printLocs()

    print "right:", right, " out of", trials, tests / trials
    return (float(right) / trials) < cert


def testFunc(case):
    print "testing ", case.likelihoodObj.name(), "randomDag=", case.randomDag

    return testChop(case.likelihoodObj, case.randomDag, case.falseNeg,
                    case.multi)


testCases.runTests(testFunc, testCases.BBChopTestCases)

## for testing a specific case:
if 0:
    import copy
    myCase = copy.copy(testCases.single)
    myCase.randomDag = True
    testFunc(myCase)