Quantcast
Channel: Data Science, Analytics and Big Data discussions - Topics tagged data_science
Viewing all articles
Browse latest Browse all 787

Need your help to find all matched item in LHS of Apriori(R)

$
0
0

@kumard wrote:

Hi Expert,

Hello Everyone!
I run the apriori to find association between product and item purchased.
Product Item1 Item2 Item3 Item4 Item5 Item6
Biscuit 1 0 0 1 1 1
Soap 1 1 1 1 1 1
Tea 1 0 0 0 0 0
Biscuit 1 0 1 0 0 0
Soap 1 1 1 0 0 0
Biscuit 1 0 0 0 0 0

Now how can I set LHS or RHS such that I will get all product list when condition for all items are true (i.e. item1=1 and item2=1 and item3=1 and item4=1 and item5=1 and item6=1).
Along with this, the program should retrieve all products when more than or equal to 50% of item are satisfied.
I use subset to capture all items=1 but its not working.

library(arules)
prod_item = read.csv(“D:/name.csv”)
df_trans = as(prod_item,‘transactions’)
rules = apriori(df_trans,parameter = list(minlen=5,support=0.5, confidence=0.5))

I use minlen=5 to satisfy more than 5 condition true.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 787

Trending Articles