0
$\begingroup$

Here's the code that I'm using:

library(arules)

library(arulesViz)

library(tidyverse)

library(readxl)

library(knitr)

library(ggplot2)

library(lubridate)

library(plyr)

library(dplyr)

tr <- read.transactions('D:/work/ML/Data/10OctMergedParts.csv', format = 'basket', sep=',')

association.rules <- apriori(tr, parameter = list(supp=0.01, conf=0.8,maxlen=10,maxtime = 0))

summary(association.rules)

write(association.rules, file = "D:/work/ML/Data/DemoInputs/10OctAssoc_P_B_D_Support1ConfPoint8.csv", sep = ",")

print("----------DONE---------------")

The output I get is :

Parameter specification: confidence minval smax arem aval originalSupport maxtime support minlen

maxlen target ext 0.8 0.1 1 none FALSE TRUE 0 0.01 1 10 rules TRUE

Algorithmic control: filter tree heap memopt load sort verbose 0.1 TRUE TRUE FALSE TRUE 2 TRUE

Absolute minimum support count: 63

set item appearances ...[0 item(s)] done [0.00s].

set transactions ...[958 item(s), 6371 transaction(s)] done [0.01s].

sorting and recoding items ... [242 item(s)] done [0.00s].

creating transaction tree ... done [0.00s].

checking subsets of size 1 2 3 4 5 6 7Error in apriori(tr, parameter =

list(supp = 0.01, conf = 0.8, maxlen = 10, : not enough memory. Increase minimum support!

When I run this with the sample dataset which is available online 'Online Retail.xlsx'. I can see that this gets executed without the out-of-memory error.

This is the result with the online data:

set item appearances ...[0 item(s)] done [0.00s].

set transactions ...[7876 item(s), 22191 transaction(s)] done [0.17s].

sorting and recoding items ... [2324 item(s)] done [0.01s].

creating transaction tree ... done [0.01s].

checking subsets of size 1 2 3 4 5 6 7 8 9 10 done [0.24s].

writing ... [49122 rule(s)] done [0.10s].

creating S4 object ... done [0.04s].

I can see that the number of items are much more in the online data and the transaction length is also much higher than the data I have. {max transaction length in my data is 241 and that of the online data is ~500}

Please can someone help me understand why things are not working with my dataset?

$\endgroup$
1
  • $\begingroup$ This needs formating $\endgroup$ Commented Oct 11, 2023 at 10:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.