2

Currently I am working on item-item based recommendation system using r. The package which I have used is arules. I have done my basic models but I want to modify my model with following criteria:

  1. In the apriori algo. We will receive only one output, not multiple output. I want multiple output value in the rhs side. For example:

        lhs                                                 rhs
{GH DAILY MOONG DAL PREMIUM 1kg,                                                                                            
MDH POW SPICE DEGHI CHILLI 100g,PREM 1kg}         => {DAILY OTH PULSE CHANA DAL...
                                                  Rice}
  1. My recommendation system totally based on item-item. Is there any other algorithm or package exist in r which will give me better business output?
  2. How to calculate confidence and support value? For my case I am using default values.

My code is given below:

#Create Sparse Matrix
dataset = read.transactions('/Users/Nikita/Downloads/Reco_System/market_basket_before_model.csv', sep = ',', rm.duplicates = TRUE)
summary(dataset)
itemFrequencyPlot(dataset, topN = 20, type = 'absolute')

#1st cut
# Training Apriori on the dataset
rules = apriori(data = dataset, parameter = list(support = 0.001, confidence = 0.8))

# Visualising the results
inspect(sort(rules, by = 'lift')[1:30]) 

Thanks in advance.

CKE
  • 1,533
  • 19
  • 18
  • 29
Nikita Agarwal
  • 343
  • 1
  • 3
  • 13
  • 1
    Welcome to Stack Overflow. Please [format your code](https://meta.stackexchange.com/a/22189/371738) appropriately. In addition [provide example data](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610) in order to make your issue reproducible. – jay.sf Jul 05 '18 at 10:58

1 Answers1

1

Most implementations of association rule mining algorithms restrict the RHS of the rules to a single item to avoid further combinatorial explosion.

Michael Hahsler
  • 2,965
  • 1
  • 12
  • 16