コード例 #1
0
ファイル: itemmining_tests.py プロジェクト: Altons/pymining
    def test_sam(self):
        ts1 = perftesting.get_default_transactions()
        sam_input = itemmining.get_sam_input(ts1)
        report = itemmining.sam(sam_input, 2)
        self.assertEqual(17, len(report))
        self.assertEqual(6, report[frozenset(['b', 'd'])])

        ts2 = perftesting.get_default_transactions_alt()
        sam_input = itemmining.get_sam_input(ts2)
        report = itemmining.sam(sam_input, 2)
        self.assertEqual(19, len(report))
        self.assertEqual(5, report[frozenset(['a', 'b'])])
コード例 #2
0
    def test_sam(self):
        ts1 = perftesting.get_default_transactions()
        sam_input = itemmining.get_sam_input(ts1)
        report = itemmining.sam(sam_input, 2)
        self.assertEqual(17, len(report))
        self.assertEqual(6, report[frozenset(['b', 'd'])])

        ts2 = perftesting.get_default_transactions_alt()
        sam_input = itemmining.get_sam_input(ts2)
        report = itemmining.sam(sam_input, 2)
        self.assertEqual(19, len(report))
        self.assertEqual(5, report[frozenset(['a', 'b'])])
コード例 #3
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
def test_sam(should_print=False, ts=None, support=2):
    if ts is None:
        ts = get_default_transactions()
    sam_input = get_sam_input(ts, lambda e: e)
    fis = set()
    report = {}
    n = _sam(sam_input, fis, report, support)
    if should_print:
        print(n)
        print(report)
    return (n, report)
コード例 #4
0
def test_sam(should_print=False, ts=None, support=2):
    if ts is None:
        ts = get_default_transactions()
    sam_input = get_sam_input(ts, lambda e: e)
    fis = set()
    report = {}
    n = _sam(sam_input, fis, report, support)
    if should_print:
        print(n)
        print(report)
    return (n, report)