I am mining some rules using the arules
and arulesviz
packages in R. I was able to specify the LHS and RHS for the rule mining. However, I want to specify multiple parameters in the LHS and RHS and then check the support and confidence on these rules.
I have tried mining the rules specifying the LHS but the results I am getting include both, rules for each parameter as well as rules for both parameters combined.
rules_sales <- apriori(sales,
parameter=list(support =0.001, confidence =0.001, minlen=2, maxlen=4),
appearance = list(lhs=c("warehouse=Antwerp", "cargo=Drones"),
rhs=paste0("importCountries=", unique(sales$importCountries)), default="none"))
inspect(rules_sales)
Expected Result should only include
{warehouse=Antwerp,cargo=Drones} => {importCountries=***} 0.030937427 0.54508197 4.1074625 266
and not
{warehouse=Antwerp} => {importCountries=***} 0.030937427 0.54508197 4.1074625 266