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

How to sort association rules by lhs or rhs in R

I have set of rules from apriori algorithm. Sorting them by lift, confidence or support is easy: rules.sorted = sort(rules, by="lift") But let's say I have small set of rules with a few different rhs elements. I would like to view rules sorted by…
5
votes
2 answers

How to add ano more measure of interest in the arules package

I would like to add two additional measures as a results of the "inspect" function in arules package. They are Kulczynski and imbalance ratio. Would you help me with info, where to find the code of inspect function and how to modify it. Thanks
5
votes
1 answer

View built-in dataset from a package

I have installed the packages arules. How can I view the built-in dataset as usual? I tried: library(arules) data(Groceries) Groceries While it only offer me: transactions in sparse format with 9835 transactions (rows) and 169 items…
useR
  • 3,062
  • 10
  • 51
  • 66
5
votes
4 answers

Package arules in R: getting rules with only one item in the left-hand side

I am using the package arules in R to generate association rules. I would like to restrict the rules so that in the left-hand side there's only one particular element, let's call it "potatoe". If I do this: rules <- apriori(dtm.mat, parameter =…
user2405243
  • 51
  • 1
  • 2
4
votes
1 answer

arulesSequences cspade function: "Error in file(con, "r") : cannot open the connection"

One day I tried to execute my routine cspade sequences mining in R and it suddenly failed with error and some very strange print to console. Here is the example code: library(arulesSequences) data(zaki) cspade(zaki, parameter=list(support=0.5)) It…
Finarvi
  • 51
  • 4
4
votes
1 answer

How to convert dataframe into usable format for sequence mining in R?

I'd like to do sequence analysis in R, and I'm trying to convert my data into a usable form for the arulesSequences package. library(tidyverse) library(arules) library(arulesSequences) df <- data_frame(personID = c(1, 1, 2, 2, 2), …
mowglis_diaper
  • 479
  • 1
  • 9
  • 18
4
votes
2 answers

Removing inverted (reverse/duplicate) rules from Apriori result in R

I have implemented Apriori algorithm on my dataset. The rules I get though are inverted repititions that is: inspect(head(rules)) lhs rhs support confidence lift count [1] {252-ON-OFF} =>…
Lorenzo Benassi
  • 621
  • 1
  • 8
  • 31
4
votes
2 answers

Applying rules generated from arules in R to new transactions

My goal is to use rules generated by the R package arules to predict the topic of each transaction (each transaction has 1 topic), where each transaction is the set of words in a document. I have a training set trans.train (used to create the…
Magic8ball
  • 145
  • 1
  • 2
  • 8
4
votes
2 answers

Filter of rhs with arules/apriori is not working

I'm using arules::apriori with a binary matrix and want to only create rules that have one particular column on the RHS. This is specified in the documentation but doesn't seem to work. It is easy enough to filter it post hoc to get this but I waste…
nsfy33
  • 115
  • 1
  • 6
4
votes
3 answers

R error with inspect() function

my objective is to apply association rules for text mining. i have this sample of strings: sample.word = c("abstracting","abstracting workflow","access control","access information","access methods","access patterns","access permissions","access to…
ntrax
  • 457
  • 4
  • 22
4
votes
1 answer

R arules - subset of transactions that match a rule

I'm using the R package arules. I have some transactions and a rule (see below). I want the subset of transactions that break the rule. How can I do that? This is the set up: library(arules) data(Adult) summary(Adult) rules =…
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
3
votes
1 answer

arulesViz "graph" plot doesn't show the connections

I'm using the arulesViz library to plot some graphs about recommendation systems. I have some rules and I want to plot them in a graph plot. plot(regras, method = "graph", control = list(type = "itens")) This is what I got:
3
votes
1 answer

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

I understand there is another question already for this...I am new and thus unable to comment on it. Additionally, I don't believe the question was answered. Anyway I am running arules pkg: aprori. I am using the following params: testbasket_rules…
3
votes
1 answer

number of items read is not a multiple of the number of columns with read.transactions

I am am getting the warning message in the title number of items read is not a multiple of the number of columns I have read about this warning message but I still don't figure out why I got it. Here's my code: data <-…
Mouna Belaid
  • 653
  • 1
  • 6
  • 11
3
votes
1 answer

R apriori algorithm-How to assign top items of ItemFrequency() to a vector?

I am working in R apriori algorithm which have a function ItemFrequencyPlot() of arules library. This function create a plot by passing argument (topN).Here we pass (Top N =20) which plot the top 20 items.Basically the function find top items on…
Qaiser iqbal
  • 306
  • 1
  • 14
1
2
3
23 24