Orange Forum • View topic - Association rule comparison

Association rule comparison

A place to ask questions about methods in Orange and how they are used and other general support.

Association rule comparison

Postby cn12 » Wed Aug 14, 2013 4:38

Is there an easy way to compare two association rules? I would like to find out if same/similar rules are found in two market-basket sets that contain the same features/class. Ideally I want to compare the left sides of the rules. I thought I could do this by reverting to data instance comparison but that is not clear how to do either. Is there a functionality to support set operations for datasets (data instances, association rules, etc) in Orange?

Re: Association rule comparison

Postby Ales » Mon Aug 19, 2013 13:23

cn12 wrote:Is there a functionality to support set operations for datasets (data instances, association rules, etc) in Orange?

Data instances are hashable/comparable but only on the regular features/classed and not meta attributes.
Unfortunately for rules induced by AssociationRulesSparseInducer on sparse basket datasets the 'left' and 'right' attributes will have only meta attributes/values. This means you would have to implement the comparison yourself.

For instance you could use
Code: Select all
frozenset((v.variable, float(v)) for v in r.left.get_metas().values())

instead of the 'left' attribute to compare/hash the rule.
I think this should be a unique representation of a rule side as long as the rules are induced on datasets with the same domain.


Return to Questions & Support