示例#1
0
def test_on_df_with_missing_entries():
    # this is a data frame where information about
    # antecedents and consequents have been cropped
    # see https://github.com/rasbt/mlxtend/issues/390
    # for more details
    dict = {'itemsets': [['177', '176'], ['177', '179'],
                         ['176', '178'], ['176', '179'],
                         ['93', '100'], ['177', '178'],
                         ['177', '176', '178']],
            'support': [0.253623, 0.253623, 0.217391,
                        0.217391, 0.181159, 0.108696, 0.108696]}

    df = pd.DataFrame(dict)

    numpy_assert_raises(KeyError, association_rules, df)
示例#2
0
def test_on_df_with_missing_entries():
    # this is a data frame where information about
    # antecedents and consequents have been cropped
    # see https://github.com/rasbt/mlxtend/issues/390
    # for more details
    dict = {
        'itemsets': [['177', '176'], ['177', '179'], ['176', '178'],
                     ['176', '179'], ['93', '100'], ['177', '178'],
                     ['177', '176', '178']],
        'support':
        [0.253623, 0.253623, 0.217391, 0.217391, 0.181159, 0.108696, 0.108696]
    }

    df = pd.DataFrame(dict)

    numpy_assert_raises(KeyError, association_rules, df)
示例#3
0
def test_wrong_metric():
    numpy_assert_raises(ValueError, association_rules, df_freq_items,
                        'unicorn')
示例#4
0
def test_no_itemsets_col():
    df_no_itemsets_col = df_freq_items.loc[:, ['support']]
    numpy_assert_raises(ValueError, association_rules, df_no_itemsets_col)
示例#5
0
def test_wrong_metric():
    numpy_assert_raises(ValueError, association_rules,
                        df_freq_items, 'unicorn')
示例#6
0
def test_no_itemsets_col():
    df_no_itemsets_col = df_freq_items.loc[:, ['support']]
    numpy_assert_raises(ValueError, association_rules, df_no_itemsets_col)