How to calculate support/ confidence and lift for merged itemsets like {A}->{B,C}

501 - not implemented picture 501 - not implemented · Sep 3, 2013 · Viewed 21.2k times · Source

I have a list of itemsets of {A_i}->{X}.

Like:

{A}->{X}
{A}->{Z}
{A,B}->{X}
{A,B}->{W}

Now I want to merge the itemsets like:

{A}->{X,Z}
{A,B}->{X,W}

But I don't know how to calculate support, confidence and lift of every rule.
Is this the sum/count or is this the minimum of all similar itemsets?

For the support the minsupport of all similar sets make sense. But Confidence and lift?

Answer

Phil picture Phil · Sep 11, 2013

I think that you are refering to association rules.

For an association rule X--> Y, the support of the rule is denoted as sup(X-> Y) and is the number of transactions where XUY appears divided by the total number of transactions.

the confidence is the number of transactions where XUY appears divided by the number of transactions where X appears.

the lift is defined as : lift(X-->Y) = ( (sup(X U Y)/ N) / (sup(X)/ N*sup(Y)/ N ), where N is the number of transactions in the transaction database, sup(X∪Y) is the number of transactions containing X and Y, sup(X) is the number of transactions containing X sup(Y) is the number of transactions containing Y.

For an example of lift calculation, you can check the example 23 of the SPMF software:

http://www.philippe-fournier-viger.com/spmf/index.php?link=documentation.php#lift