I am using artules package, R to find the positively related products. I use some measures provided by the function interestMeasure to evaluate the rules. However, I found that the ranges for the measures kappa and leastContradiction are different from the package manual. Here is an example, the code is in the explanation to interestMeasure in the package manual:

data("Income")
rules <- apriori(Income)
quality(rules)$kappa <- interestMeasure(rules,measure='kappa',transactions = Income)
quality(rules)$leastContradiction <- interestMeasure(rules,measure='leastContradiction',transactions = Income)
try <- as(rules,'data.frame')

I changed a little bit for convenience. In the example, the ranges of leastContradiction and kappa are:

> summary(try$leastContradiction)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
0.08794 0.13920 0.17000 0.18930 0.22170 0.90460 
> summary(try$kappa)
     Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
-43160000 -20510000 -19140000 -17660000 -12220000  -8042000 

I tried these two measures on my own data, the summary is:

> summary(myData1$kappa)
          Min.        1st Qu.         Median           Mean        3rd Qu.           Max. 
-5767000000000 -5765000000000 -5756000000000 -5745000000000 -5728000000000 -5610000000000 
> summary(myData1$leastContradiction)
     Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
-218.9000   -5.4530   -2.0120   -4.9540   -1.1050    0.8824 

However, in the package manual, these two measures are explained like: enter image description here

One can see the ranges are very different. So, should I narrow the ranges for such measures to [-1,1] by myself?

1

There are 1 best solutions below

0
On BEST ANSWER

This was indeed a bug. Resolution: Added missing parentheses in kappa calculation and fixed equation for least contradiction. The fix is now available in the development version on github and will be part of the next release (arules 1.2-3).