chuanconggao / PrefixSpan-py

The shortest yet efficient Python implementation of the sequential pattern mining algorithm PrefixSpan, closed sequential pattern mining algorithm BIDE, and generator sequential pattern mining algorithm FEAT.
https://git.io/prefixspan
MIT License
414 stars 92 forks source link

generator returns error #8

Closed AllerLydia closed 6 years ago

AllerLydia commented 6 years ago

TypeError: 'int' object is not subscriptable

using API example code.

chuanconggao commented 6 years ago

I am sorry but I am not sure which example your are referring to. Please give more specific details.

AllerLydia commented 6 years ago

from prefixspan import PrefixSpan

db = [ [0, 1, 2, 3, 4], [1, 1, 1, 3, 4], [2, 1, 2, 2, 0], [1, 1, 1, 2, 2], ]

ps = PrefixSpan(db)

print(ps.topk(5, generator=True))

using Ipython notebook.

chuanconggao commented 6 years ago

Thanks. I will take a look.

chuanconggao commented 6 years ago

Issue in upstream dependence extratools. Will fix soon. Thank you for reporting.

flxw commented 6 years ago

Wow you are fast! Just wanted to report the same, thanks for going after it!

chuanconggao commented 6 years ago

Updated extratools to 0.8.1 and bumped PrefixSpan-py to 0.5.2. The issue should be fixed. Please update your local versions.

Thank you. Please let me know if there is any further issue.