-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME.Rmd
More file actions
62 lines (45 loc) · 1.83 KB
/
Copy pathREADME.Rmd
File metadata and controls
62 lines (45 loc) · 1.83 KB
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
59
60
61
---
output: github_document
---
```{r echo=FALSE, results = 'asis'}
pkg <- 'arulesNBMiner'
source("https://raw.githubusercontent.com/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,
verbose = 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://doi.org/10.48550/arXiv.0803.3224)
* 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.