Skip to content

Commit

Permalink
small fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhahsler committed Dec 14, 2015
1 parent 6752ae5 commit 887b45c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 22 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: arules
Version: 1.3-0.1
Date: 2015-xx-xx
Version: 1.3-1
Date: 2015-12-13
Title: Mining Association Rules and Frequent Itemsets
Authors@R: c(person("Michael", "Hahsler", role = c("aut", "cre", "cph"),
email = "[email protected]"),
Expand Down
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ useDynLib(arules,
)

import("methods")
importFrom("stats", "predict", "aggregate", "as.dist", "cor", "rpois") ## we want to add methods
importFrom("stats", "predict", "aggregate", "as.dist", "cor",
"rpois", "p.adjust") ## we want to add methods
importFrom("utils", "head", "write.table") ## we want to add methods
import("graphics")

Expand Down
19 changes: 8 additions & 11 deletions R/is.significant.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.



## uses fishers exact test to find significant rules (corrected)


setMethod("is.significant", signature(x = "rules"),
function(x, transactions, alpha = 0.01, adjust = "bonferroni") {
p <- quality(x)[["fishersExactTest"]]
if(is.null(p)) p <- interestMeasure(rules,
measure = "fishersExactTest",
transactions = transactions)
if(adjust != "none") p <- p.adjust(p, method = adjust)
p <= alpha
})
function(x, transactions, alpha = 0.01, adjust = "bonferroni") {
p <- quality(x)[["fishersExactTest"]]
if(is.null(p)) p <- interestMeasure(x,
measure = "fishersExactTest",
transactions = transactions)
if(adjust != "none") p <- p.adjust(p, method = adjust)
p <= alpha
})

9 changes: 4 additions & 5 deletions inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Changes in version 1-3-0.1 (xx/xx/2015)
Changes in version 1-3-1 (12/13/2015)
* we now require R 2.3.0 so cbind in Matrix works.
* is.maximal is now also available for rules.
* added is.significant for rules (used Fishers exact test).
* added is.significant for rules (uses Fishers exact test with correction).
* added is.redundant for rules.
* added support for multi-level analysis.
* APparameter: confidence shows not NA for frequent itemsets.

* added support for multi-level analysis (aggregate).
* APparameter: confidence shows now NA for frequent itemsets.

Changes in version 1-3-0 (11/11/2015)
* removed deprecated WRITE and SORT functions.
Expand Down
2 changes: 1 addition & 1 deletion man/affinity.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ s <- sample(Adult, 500)
s

a <- affinity(s)
summary(as.vector(a))
image(a)
}
\references{
Charu C. Aggarwal, Cecilia Procopiuc, and Philip S. Yu (2002)
Expand Down
4 changes: 2 additions & 2 deletions man/random.transactions.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ image(trans)

## use the method by Agrawal and Srikant (1994) to simulate transactions
## which contains correlated items. This should create data similar to
## T10I4D100K (just only 1000 transactions)
## T10I4D100K (we just create 100 transactions here to speed things up).
patterns <- random.patterns(nItems = 1000)
summary(patterns)

trans2 <- random.transactions(nItems = 1000, nTrans = 1000,
trans2 <- random.transactions(nItems = 1000, nTrans = 100,
method = "agrawal", patterns = patterns)
image(trans2)

Expand Down

0 comments on commit 887b45c

Please sign in to comment.