コード例 #1
0
    def test_manifest(self):
        swap = SWAP()
        golds = {0: 1, 1: 1, 2: 0, 3: 0}
        swap.set_gold_labels(golds)

        for x in range(10):
            for y in range(10):
                swap.classify(Classification(x, y, 0))
        swap.process_changes()

        print(swap.manifest())
コード例 #2
0
    def test_stats(self):
        swap = SWAP()
        golds = {0: 1, 1: 1, 2: 0, 3: 0}
        swap.set_gold_labels(golds)

        for x in range(10):
            for y in range(10):
                swap.classify(Classification(x, y, 0))
        swap.process_changes()

        stats = swap.stats
        print(stats)
        assert type(stats) is Stats
コード例 #3
0
    def test_doesnt_override_golds(self):
        swap = SWAP()
        golds = {1: 1, 2: 0, 3: 0}
        swap.set_gold_labels(golds)

        bureau = swap.subjects
        print(bureau)

        cl = Classification(0, 2, 0)
        cl.gold = 1
        swap.classify(cl)
        swap.process_changes()
        print(bureau.get(1))
        assert bureau.get(2).gold == 0