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
2
votes
0 answers

(package arules) How can I export CSV file into r and transfer it into transactions?

It went well when I do this library(arules) mydata=read.csv("data.csv") First I tried this data <- as(mydata, "transactions") ## Error in asMethod(object) : ## column(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ## 17, 18, 19, 20,…
Yaxin Li
  • 21
  • 2
2
votes
2 answers

R: apriori error about not able to coerce NA's to nsparseMatrix

I am experimenting with the apriori algorithm in the arules package. This is what I've done: I loaded a view from SQL Server into R. Since that data is not in transactions form (to use in apriori), I had to convert it: data <- sapply(orders,…
Kim
  • 393
  • 2
  • 8
  • 18
2
votes
1 answer

cSPADE data mining in R using arulesSequences - Error while converting to "transactions" format

I'm having trouble converting my data into cSPADE compatible format. My data frame looks like- key type1 type2 type3 A-1 A B C B-2 P Q NA C-3 X NA NA When I use, dataset1<- as(dataset, "transactions") and run- rules<-…
Akshay Huria
  • 43
  • 1
  • 4
2
votes
1 answer

Association Rules Error

I am running the formula that is given below in R rules <- apriori(B4_Temp, parameter = list(minlen=2, supp=0.001, conf=0.6,target="rules"), appearance = list(rhs=c("Location Info=Level1"),default="lhs"), control = list(verbose=F)) I am…
user3292373
  • 483
  • 3
  • 8
  • 25
2
votes
2 answers

How can I constrain the apriori function in R to consider only specific value items in LHS?

In R, I am trying to use the apriori function for Association Rule Learning. I have a data set like this: A B C D E 1 0 0 1 0 1 0 1 0 1 1 1 1 0 1 0 0 0 1 0 I am interested in cases where E = 1, which I can get by doing: inspect( subset(…
2
votes
1 answer

Creating specific rules with arules in r

I have a large data set (matrix of 0s and 1s) with 200 variables(each variable is an item) and almost 1M rows (each row is a transaction). I use "arules" package in R for association rule mining. I considered 2 items and I want to create all the…
Mark Olson
  • 55
  • 1
  • 4
2
votes
1 answer

Is there a way to have more than 1 consequents using the arules package in R

I am using the arules package in R to create association rules. The rules that are created always have just one term on the RHS (consequent). Does anyone know if there is a way to get more than 1 term on the RHS?
wilsonm2
  • 561
  • 2
  • 7
  • 17
1
vote
0 answers

Adding hierarchy to transaction data in R

I am learning pattern mining and want to do multi level association mining. My dataset contains 25035 unique transactions and each transaction can consist of 1 to 12 items. In total, there are 3788 products, 18 subcategories and 3 categories. My…
1
vote
1 answer

error with arules::read.transactions(): "'cols' does not match entries in header of file" even though they do match

I have a text file like the following: transactionID item T100 l1,l2,l3 T200 l2,l4 T300 l2,l3 T400 l1,l2,l3 T500 l1,l3 T600 l2,l3 T700 l1,l3 T800 l1,l2,l3,l5 T900 l1,l2,l3 And I would like to read it as a transaction file for arules. I used the…
Norhther
  • 545
  • 3
  • 15
  • 35
1
vote
1 answer

Error using arules - lhs is an unkown item label

I am using Apriori Association rules in R with a database structured as the following. using the following code: library(arules) library(arulesViz) # Convert data into dataframe with two factors data3 <-…
Jelle M
  • 11
  • 2
1
vote
1 answer

How to change the font size, color, and style while setting `engine = htmlwidget` as a parameter of plot function?

Background of the Problem I was trying the plot the rules, found after applying mineCARs of R. plot(top10subRules, method = "graph", engine='htmlwidget') However, the default font, and it's color does not become completely visible when I set the…
Md. Sabbir Ahmed
  • 850
  • 8
  • 22
1
vote
1 answer

R arules: Signify Duplicate itemsets

I am qualitatively coding a dataset based on theme. Each observation is allowed two themes, therefore I have two columns with the same variable list. When I run arules, it see "v1=alpha; v2=beta" as different item than "v1=beta;v2=alpha." As…
ddubs1978
  • 19
  • 1
1
vote
0 answers

How to extract row entries of the basket items of the data after generating rules by Apriori in R?

I've implemented the Apriori Algorithm on the default "Groceries" dataset present in the "arules" package of R. And already got the desired output in the form of a dataframe showing the Apriori rules and the corresponding support, confidence & lift…
EnigmAI
  • 157
  • 1
  • 9
1
vote
0 answers

arules grouped matrix plot and labels in r

I'm currently using the arulesViz package in order to create some clusters within my rules. You can have an exemple of the clustering method provided by the arulesViz packages. The only thing which is bothering are the clusters labels which are not…
1
vote
1 answer

Groceries dataset: List transaction with only n items

this is a special question and since I have been for lot of weeks of research I didn't found any answer. The dataset is Groceries I get with this commands: install.packages("arules") library(arules) data(Groceries) I try to show the number of…
Noemie
  • 121
  • 1
  • 9