3
$\begingroup$

Since new to association rules need help for identifying the most frequent extra service ordered together with the products. And to derive the association rules, I have used arules R package on past data.

I have collected and shaped the dataset as like you can download sample dataset from link (https://www.dropbox.com/s/4g5sqag9afsttmo/finaldf2.csv).

When I tried it with the following set of R codes, it can't calculate the association rules between product and services. But it calculates the rules between all services.

Can any one guide me why I am getting set of 0 rules for calculation of association rules of product. Am I doing something wrong to calculate the associations. Or My dataset should be different.

Here are the R codes generated for arules:

# Loading the library
library(arules)    

# Loading the dataset 
product.transaction.set <- read.csv("finaldf2.csv")    

# calculating the association with apriori algo
rules <- apriori(product.transaction.set, parameter = list(support = 0.4,conf = 0.6,target = "rules"))

## 1 - for product
# Deriving the association rules for productname
rules.sub.product <- subset(rules, subset = lhs %pin% "LD") # output -> set of 0 rules     

# for print the calculated association rules
inspect(rules.sub.product) 

## 2- for add on services ()
# Deriving the association rules for add on services
rules.sub.services <- subset(rules, subset = lhs %pin% "AO1") # output -> set of 1 rules 

# for print the calculated association rules
inspect(rules.sub.services) 
$\endgroup$
1
$\begingroup$

It was the problem related to value of the support and confidence. Based on the problem and dataset information we can vary them and generate the association rules. In my case I got it by providing the support=0.1 and confident =0.4

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.