4
$\begingroup$

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
$\endgroup$

2 Answers 2

1
$\begingroup$

If Python 3 is an option, Orange 3 features FP-growth in its Orange3-Associate add-on:

pip3 install Orange3-Associate

It's well documented: http://orange3-associate.readthedocs.org/

Apriori due to its slowness and resource requirements, as you'd noticed, really isn't an algorithm to consider anymore.

$\endgroup$
-1
$\begingroup$

It is not available in Orange, but i would try FP-Growth. Its way faster in combination with low support values than apriori!

$\endgroup$
4
  • $\begingroup$ What's not available in Orange? I actually tried around other libs with Apriori and FP-Growth and indeed you're right, FPG is way faster but the results look a bit different (maybe just because of the lib I used) but still good. I'd go that way I guess. $\endgroup$
    – Chris
    Jul 7, 2015 at 15:29
  • $\begingroup$ for all I know FP-Growth is not available in Orange. The results should be the same for same input data when you use same min-support / min-confidence, but like you said, different libs are using different variants of apriori / FP-growth for better performance. $\endgroup$
    – Johannes
    Jul 8, 2015 at 8:31
  • $\begingroup$ Yes, I see. I tried several libs now, FP-Growth as well and it's indeed faster. Still playing around with different libs - Orange seems not that awesome to me after I wrapped my head more around it. $\endgroup$
    – Chris
    Jul 10, 2015 at 13:23
  • $\begingroup$ Orange 3 now seem to feature FP-growth in its Orange3-Associate add-on. Please see the other answer. :) $\endgroup$
    – K3---rnc
    Jan 19, 2016 at 0:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.