Questions tagged [arules]

arules is an R package, which provides the infrastructure for representing, manipulating and analyzing transaction data and patterns: frequent itemsets and association rules

The R package arules implements the basic infrastructure for creating and manipulating transaction databases and basic algorithms to efficiently find and analyze association rules. Several more packages provide provide additional functionality like frequent sequence mining, association rule visualization and associative classification techniques:

351 questions
1
vote
0 answers

How to retrieve summary elements from S4 class object?

I'm doing some in-line calculations in R Markdown. Just wondering how to retrieve summary elements of transactional data? Here is the code I have so far: ## Libraries library(arules) ## Data data("Adult") ## Other summaries length(Adult) # no.…
user8065556
1
vote
1 answer

R how to incorporate categories of item set in transactions data

In R I would like to create a transactions data with the following data frame so I can run apriori in package arules. It has transaction IDs, item IDs and category IDs, parents of items. Transaction_ID Item_ID Category_ID T01 A001 A01 T01 A002 …
davidzxc574
  • 471
  • 1
  • 8
  • 21
1
vote
1 answer

Convert large data frame into transaction format for arules in R

I have several historical orders information with two columns as a data frame: OrderID and Item. It contains about 1 Million records. I am trying to do association rules mining with this data frame and in order to utilize the arules package, i will…
Felix Zhao
  • 459
  • 5
  • 9
1
vote
2 answers

How to convert dataframe to Rules (arules package)?

I converted some rules to a dataframe with the DATAFRAME() fx from arules package. I deleted some rules and I want to convert back to class rules. I looked for documentation but I cannot find anything to do this. I already tried to…
Elisa
  • 11
  • 1
1
vote
1 answer

Apriori Not enough memory

I am using R and I use the following command and I get the error not enough memory. Increase minimum support! I tried increasing the support to 0.5 but I am still getting the same error. Any help would be appreciated. My data is (5000,2). >…
Dinesh
  • 79
  • 9
1
vote
1 answer

Arules Package: Discretize a continuous vector into a discrete vector with specific categories to produce a table of frequencies in R

Overview I have a continuous vector called "Canopy_Index" and another vector called "Species", which is a factor. My aim is to discretize the Canopy_Index vector using the R-code below into a discrete vector containing specific percentage…
1
vote
2 answers

Generating 2-itemset rules with Arules in R

I'm using Arules library in R to generate rules: rules = apriori(data = dataset, parameter = list(support = 0.001, confidence = 0.6, minlen=2)) I understand the minlen=2 avoids rules of the form {} => {beer}. In arules, is it possible to restrict…
kami
  • 361
  • 3
  • 15
1
vote
1 answer

Transform a dataframe to a transaction object for the apriori function without exporting and reloading the dataframe

I'm getting in trouble transforming a dataframe object into a transaction object. I create a dataframe grouped by InvoiceNumber and the list of products separated by ',' (the dataframe then contains two columns), everything is ok, df =…
Nic
  • 15
  • 6
1
vote
1 answer

Building the “transactions” Class for Association Rule Mining in SparkR using arules and apriori

I am using SparkR and trying to convert a "SparkDataFrame" to "transactions" in order to mine association of items/ products. I have found a similar example on this link…
Dale Seema
  • 11
  • 4
1
vote
1 answer

Discretize variables using SparkR

I want to discretize a variable using R, preferably SparkR, so that the desired results would be like the following. library(arules) mtcars %>% mutate(bins = discretize(x = mpg, method = "interval", breaks = 4)) I checked the document but could…
Geet
  • 2,515
  • 2
  • 19
  • 42
1
vote
3 answers

Sequence of patterns in R sequence and events issues

I am trying to work with frequent sequences in R (SPADE). I have the following data set: d1 <- c(1:10) d2 <- c("nut", "bolt", "screw") data <- data.frame(expand.grid(d1,d2)) data$status <- sample(c("a","b","c"), size = nrow(data), replace =…
Matthew Doering
  • 321
  • 3
  • 9
1
vote
1 answer

Correctly convert "data.frame" to "transactions" for arules

I have the following data.frame: > str(noticias_json, list.len = 10) 'data.frame': 1771 obs. of 3 variables: $ bairro:List of 1771 ..$ : chr "icarai" ..$ : chr "nacoes" ..$ : chr "danilo passos" "serra verde" …
Alef Duarte
  • 112
  • 1
  • 3
  • 13
1
vote
2 answers

Arules in R: A very high measure for lift

Running Apriori with the Arules package, generates rules with very high lift. For example: A -> B support=0.0023 confidence=0.6832 lift=28.02 (min_support=0.002 and min_conf=0.2) In some rules, the lift is as high as 250! I have seen people discuss…
Jay
  • 359
  • 2
  • 14
1
vote
1 answer

Association Rule in R: how to select rules based on item?

I am using r arules package to generate rules around a transaction dataset. In the dataset, I have over 500 transactions with items such as apples, beer and so on. I know how to generate the rules and sort them based on support or confidence, but…
ELI
  • 359
  • 1
  • 4
  • 20
1
vote
2 answers

Capture the output of arules::inspect as data.frame

In "Zero frequent items" when using the eclat to mine frequent itemsets, the OP is interested in the groupings/clusterings based on how frequent they are ordered together. This grouping can be inspected by the arules::inspect…
hpesoj626
  • 3,529
  • 1
  • 17
  • 25