I'm trying to wrap my head around Association rules and frequent itemsets. So I threw my data in, instead of the samples one and sometime it works, sometimes it doesn't.
rules = Orange.associate.AssociationRulesSparseInducer(data, support = 0.3)
print "%5s %5s" % ("supp", "conf")
for r in rules:
print "%5.3f %5.3f %s" % (r.support, r.confidence, r)
inducer = Orange.associate.AssociationRulesSparseInducer(support = 0.2, store_examples = True)
itemsets = inducer.get_itemsets(data)
print itemsets
print data.domain
print [data.domain[i].name for i in itemsets[4][0]]
More often than not, itemsets[4][0] shows an IndexError: list index out of range
error.
So I start playing around with support = 0.3, support = 0.5, support = 0.2 and itemsets[2][0] or itemsets[3][0].
From the docs:
support
Minimal support for the rule. Depending on the data set it should be set to sufficiently high value to avoid running out of working memory (default: 0.3).
True - I tried 0.2 and it quickly blasted my memory on a 800 rows data file.
Any idea what I should do best there or which are viable values for a shopping cart analysis?
800 rows of data (800 orders)
1 to x item(-categories) per order
15 different item-categories in the file, so my data looks like:
ItemCat1
ItemCat2, ItemCat2, ItemCat2, ItemCat2, ItemCat7, ItemCat7, ItemCat7, ItemCat7, ItemCat7
ItemCat1, ItemCat1, ItemCat1, ItemCat1, ItemCat1, ItemCat1, ItemCat1, ItemCat2
ItemCat4, ItemCat4
ItemCat1, ItemCat1, ItemCat1, ItemCat1, ItemCat1, ItemCat1, ItemCat1, ItemCat1, ItemCat2
ItemCat5