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

How to convert object of Transaction to Dataframe in R

How to convert the Dataset(Groceries) in arules package to dataframe. class(Groceries) [1] "transactions" attr(,"package") [1] "arules"
Shivpe_R
  • 1,022
  • 2
  • 20
  • 31
2
votes
1 answer

R Arules: how to remove certain itemsets from lhs/rhs

I have loaded a file as transactions in R: path = "my_file.csv" t = read.transactions(path,format="single", sep=';',cols=c("ID","Products")) #get the rules: rules = apriori(t,parameter = list(supp=0.01, conf=0.33, minlen=2, maxlen=4)) #sort by…
mik.ferrucci
  • 121
  • 1
  • 2
  • 13
2
votes
0 answers

Running apriori in Python

I am a newbie in python & trying to run association rule using apriori algorithm. I have extensively done this operation using R. For the same my work-flow was; read the csv file (let df) in R create sparse/transaction matrix using 'acast'…
Hindol Ganguly
  • 363
  • 1
  • 4
  • 16
2
votes
1 answer

R arulesSequences Find which patterns are supported by a sequence

I'm having troubles with the arulesSequences library in R I have a transactional dataset with temporal information (here, let's use the default zaki dataset). I use SPADE (cspade function) to find the frequent subsequences in the dataset.…
juliesls
  • 521
  • 4
  • 9
2
votes
2 answers

R aRules: Find closed association rules

In the aRules package in R, how could I go about efficiently finding closed association rules? i.e. Rules with a closed LHS itemset An itemset is closed iff adding any item reduces support. The package provides the following mining options: target:…
user997943
  • 303
  • 1
  • 5
  • 12
2
votes
1 answer

R arules : Extract lhs items from rules

I want to extract lhs items from a rule generated from arules. For example, {a,b,c} => {d} I want to be able to extract a,b,c and put it in a character vector, so I can iterate and do further processing based on these items. At the moment, I can…
anz
  • 987
  • 7
  • 21
2
votes
1 answer

Column to Transacction ID for association rules on dataframes from Pandas Python.

I imported a CSV into Python with Pandas and I would like to be able to use one as the columns as a transaction ID in order for me to make association rules. (link: https://github.com/antonio1695/Python/blob/master/nearBPO/facturas.csv) I hope…
Antonio López Ruiz
  • 1,396
  • 5
  • 20
  • 36
2
votes
2 answers

R item lists to wide format

I have a data frame of item lists, where each row in the data frame contain LHS and RHS association rules with the corresponding support, confidence and lift. here's the data: structure(list(rules = structure(c(13L, 4L, 28L, 1L, 24L, 15L ), .Label =…
Nir Regev
  • 135
  • 1
  • 2
  • 7
2
votes
0 answers

arules with quantity magnitude for each product

I want to use the arules package of r for market basket analysis. The issue is I do not have data for each transaction. My data is aggregated for every day. So I am thinking of comparing the quantity sold of each product. How do I input this…
2
votes
1 answer

Odd results from cSPADE in R (arulesSequences) w/ large data. Can I force numpart to 1? Are there risks?

I've been trying to use cSPADE on a dataset I have with ~7million records in my transactions file (7 million unique sequenceID x eventID pairs). The support results I get when I try to run cSPADE on this dataset seem completely wrong. However, when…
ednaMode
  • 443
  • 3
  • 14
2
votes
1 answer

how to validate association rules

I have created assocociation rules by using the the Apriori Algorithmus of the arules package. Now, i would like to validate the resultes, with Validation method (e.g. cross Validation) But i don´t find any opportunitys or function in r, which…
Tom Maier
  • 33
  • 5
2
votes
2 answers

Sorting rules by lift and confidence

I am trying to find association rules using the apriori function from arules package in R. rules <- apriori(data=data, parameter=list(supp=0.001,conf = 0.08), appearance = list(default="lhs",rhs="YOGHURT"), …
Frankln
  • 23
  • 1
  • 4
2
votes
2 answers

Error while trying to target in arules (data is in the format of web addresses)

I've successfully imported my data into R as transactions, but when I try targeting a specific website, I get this error: Error in asMethod(object) : FACEBOOK.COM is an unknown item label Is there any reason why this could be happening? Here is a…
IRI_Tyler
  • 29
  • 2
2
votes
1 answer

How can I preprocess raw data from a UCI to create itemFrequencyPlot?

I want to do a classification analysis on a voting dataset. I found in the UCI repository but I am having difficulty pre-processing it to be able to use the arules package in r. So the data looks partially like this. party, voting.issue1, …
Sophonias
  • 874
  • 5
  • 16
  • 38
2
votes
3 answers

Sequence transaction-class for arules in R

Trying to use arulesSequences packages in R. Running into the problem I've seen a lot of people encounter but no good answers for: going from data-frame or matrix to transaction data type. I've done this, as the documentation clearly states, for…
eflores89
  • 339
  • 2
  • 10
  • 27