Skip to content

apriori算法报错 #4

Description

@yongzhuo

将输入数据改为如下形式(l5改为l10),报错:

datas =   [['l1', 'l2', 'l5'], ['l2', 'l4'], ['l2', 'l3'],
                    ['l1', 'l2', 'l4'], ['l1', 'l3'], ['l2', 'l3'],
                    ['l1', 'l3'], ['l1', 'l2', 'l3', 'l5'],
                    ['l1', 'l2', 'l3'], ['l1', 'l2', 'l10'],]

报错信息如下:

text_datas ok !
Traceback (most recent call last):
  File "association/apriori.py", line 234, in <module>
    AP.fit(text_datas)
  File "association/apriori.py", line 149, in fit
    self.apriori_fre_itemset()
  File "association/apriori.py", line 54, in apriori_fre_itemset
    ck_1 = self.fre_list[i - 1]
IndexError: list index out of range

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions