I am using the arules package in R to compute the rules for a data frame having 850 columns and 1335 rows which majorly contains logical, numeric and character data we have converted the logical and character into factor.
When i set a subset (almost any) of lhs for generating the rules by using the following code the following issue is encountered. Please note that the whole set has 12,50,388 rules:
apriori(newdata,parameter=list(minlen=1,maxlen=4,supp=0.6,conf=0.6,originalSupport=FALSE,ext=TRUE),
appearance= list(lhs=lhs1,rhs=rhs1,default="none"),
control = list(memopt=TRUE,load=FALSE))
The r-studio works the first time but from the subsequent times it doesn't work, screenshot here.
Second time and after a long time the session fails, screenshot here.
A reproducible example:
library("arules")
data("Adult")
ndat<- as(Adult,"transactions")
#List of items
item1<-ndat@itemInfo
#Defining a target column
tar_var<-colnames(Adult)[ncol(Adult)]
#Defining LHS and RHS
rhs1<-item1$labels[item1$variables==tar_var]
lhs1<-item1$labels[item1$variables!=tar_var]
#taking a sample of half the length of the original data
lhs2<-sample(lhs1,round(length(lhs1)/2,0))
#Code for generating rules that kills the session
system.time(rule_gen<- apriori(ndat,parameter=list(minlen=1,maxlen=2+1,supp=0,conf=0,originalSupport=FALSE,ext=TRUE),
appearance= list(lhs=lhs2,default="rhs"),control = list(memopt=TRUE,load=FALSE)) )
please help me out, i am using a windows PC, 4 GB ram. Thanks in advance.