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
28
votes
3 answers

how to convert data.frame to transactions for arules

I read data from a csv file, the data has 3 columns, one is transaction id, the other two are product and product catagory. I need to convert this into transactions in order to use the apriori function in arules. It shows an error when I convert to…
dennis ding
  • 291
  • 1
  • 3
  • 4
21
votes
5 answers

Load a dataset into R with data() using a variable instead of the dataset name

I am trying to load a dataset into R using the data() function. It works fine when I use the dataset name (e.g. data(Titanic) or data("Titanic")). What doesn't work for me is loading a dataset using a variable instead of its name. For example: #…
pazof
  • 944
  • 1
  • 12
  • 26
17
votes
3 answers

Writing rules generated by Apriori

I'm working with some large transactions data. I've been using read.transactions and apriori (parts of the arules package) to mine for frequent item pairings. My problem is this: when rules are generated (using "inspect()") I can easily view them in…
user2432675
  • 715
  • 1
  • 6
  • 14
10
votes
2 answers

How to prep transaction data into basket for arules

Ok, so I have searched a lot and want to run arules on sales data. I just need to properly get the data in the right format and set up with the correct "factors" or "variables" and in basket form. Right now I have sales data with the Order# and then…
V1k1
  • 103
  • 1
  • 2
  • 5
9
votes
6 answers

Arules Sequence Mining in R

I am looking to use the arulesSequences package in R. However, I have no idea as to how to coerce my data frame into an object that can leverage this package. Here is a toy dataset that replicates my data structure: ids <- c(rep("X", 5), rep("Y",…
Btibert3
  • 38,798
  • 44
  • 129
  • 168
8
votes
3 answers

Association analysis with duplicate transactions using arules package in R

I want to create a transaction object in basket format which I can call anytime for my analyses. The data contains comma separated items with 1001 transactions. The first 10 transactions look like…
7
votes
2 answers

Arules returning empty LHS

I have a dataset which looks like…
Dawny33
  • 10,543
  • 21
  • 82
  • 134
7
votes
3 answers

Association rule in R - removing redundant rule (arules)

Assume we have 3 rules: [1] {A,B,D} -> {C} [2] {A,B} -> {C} [3] Whatever it is Rule [2] is a subset of rule [1] (because rule [1] contains all the items in rule [2]), so rule [1] should be eliminated (because rule [1] is too specific and its…
BigData
  • 73
  • 1
  • 1
  • 4
6
votes
1 answer

R arulesSequences - which frequent sequences are present in a transaction?

When doing frequent sequence mining, one typically wants to do the following tasks: 1. Find sequential patterns (frequent sequences). 2. Find out which sequential patterns apply to a transaction. I.e.: given a transaction, which of all of the…
PeterD
  • 429
  • 2
  • 13
6
votes
3 answers

How to get items for both LHS and RHS for only specific columns in arules?

Within the apriori function, I want the outcome to only contain these two variables in the LHS HouseOwnerFlag=0 and HouseOwnerFlag=1. The RHS should only contain attributes from the column Product. For instance: # lhs rhs …
Kim
  • 393
  • 2
  • 8
  • 18
6
votes
1 answer

Sorting Association Rules in R

I'm trying to accomplish the goals stated below and have oodles of errors. I've spent a lot of time trying to sort the rules and just print the top ten. I know how to print out the entire list. Use R, to explore generating rules in larger data…
Brent Ferrier
  • 312
  • 1
  • 4
  • 18
6
votes
2 answers

R Basket Analysis using arules package with unique order number but duplicate order combinations

R Basket analysis using arules package with unique order number but duplicate order combinations Just learning R. I'm trying to do a basket analysis using the arules package (but I'm totally open to any other package suggestions!) to compare all…
SophiaAP
  • 157
  • 1
  • 4
  • 13
5
votes
1 answer

r convert igraph into visNetwork

I found a way to convert igraph into visNetwork (refer to Interactive arules with arulesViz and visNetwork). Suppose before and after conversion from igraph to visNetwork should be the same, but my result shows after convert into visNetwork, the…
yc.koong
  • 175
  • 2
  • 10
5
votes
1 answer

base package used when arules is required. Specifying package doesn't work

I'm trying to write a single format file within the arules package, to load it in as a transaction afterwards for association rule mining. I can't use this function, since R keeps using the base::write function instead of the arules::write…
Cnidders
  • 53
  • 3
5
votes
2 answers

R - arules apriori Error in length(obj) : Method length not implemented for class rules

I am attempting to make an association rules set using apriori - I am using a different dataset but the starwars dataset contains similar issues. Using arules I was attempting to list the rules and apply an arulesViz plot. From my understanding all…
Michael Cantrall
  • 313
  • 3
  • 15
1
2 3
23 24