How to implement Association rule mining in R

In this recipe, we shall learn how to implement Association Rule Mining with the help of an example in R. We shall make use of groceries dataset for the same.

Recipe Objective: How to implement Association rule mining in R?

Association rule mining is extensively used to uncover sales correlations in transactional data or medical data sets, and it has a variety of uses. Association rules are "if-then" statements that illustrate the likelihood of associations between data items in massive data sets in various databases. e.g., Consider transactional data, what is the probability that if a customer buys item X, he will also purchase an item Z. This data about buying patterns can then be used to curate successful marketing and sales strategies. Associations are identified by scanning data for frequent if-then patterns and utilizing the support and confidence to find them. The frequency with which the items appear in the data is indicated by support. The number of times the if-then propositions are determined to be true is referred to as confidence.

Step 1: Load required packages

#loading required packages
library(arules)
library(arulesViz)
library(RColorBrewer)

Step 2: Load the dataset.

The Groceries data set contains 30 days of real-world point-of-sale transaction data from a typical local grocery outlet. The data set comprises 9835 transactions, and the items are aggregated into 169 categories. (This dataset is available on R studio as well and is provided by Michael Hahsler, Kurt Hornik, and Thomas Reutterer (2006))

#loading dataset
a = data("Groceries")
head(Groceries)

transactions in sparse format with
 6 transactions (rows) and
 169 items (columns)

Checking the frequency of all the items.

itemFrequencyPlot(Groceries,topN=10,type='absolute')

arules::itemFrequencyPlot(Groceries, topN = 20,
col = brewer.pal(8, 'Pastel2'),
main = 'Relative Item Frequency Plot',
type = "relative",
ylab = "Item Frequency (Relative)")

Step 3: Model Fitting

#fitting the model
rule = apriori(Groceries,parameter = list(supp=0.001,conf=0.9))

	Apriori

Parameter specification:
 confidence minval smax arem  aval originalSupport maxtime support minlen
        0.9    0.1    1 none FALSE            TRUE       5   0.001      1
 maxlen target  ext
     10  rules TRUE

Algorithmic control:
 filter tree heap memopt load sort verbose
    0.1 TRUE TRUE  FALSE TRUE    2    TRUE

Absolute minimum support count: 9 

set item appearances ...[0 item(s)] done [0.00s].
set transactions ...[169 item(s), 9835 transaction(s)] done [0.01s].
sorting and recoding items ... [157 item(s)] done [0.00s].
creating transaction tree ... done [0.00s].
checking subsets of size 1 2 3 4 5 6 done [0.01s].
writing ... [129 rule(s)] done [0.00s].
creating S4 object  ... done [0.00s].

rule

set of 129 rules 

It can be seen that the model created 129 rules.

Step 4: Inspecting the rules

#inspect
inspect(rule)

	      lhs                           rhs                    support confidence    coverage      lift count
[1]   {liquor,                                                                                           
       red/blush wine}           => {bottled beer}     0.001931876  0.9047619 0.002135231 11.235269    19
[2]   {curd,                                                                                             
       cereals}                  => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[3]   {soups,                                                                                            
       bottled beer}             => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[4]   {whipped/sour cream,                                                                               
       house keeping products}   => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[5]   {pastry,                                                                                           
       sweet spreads}            => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[6]   {rice,                                                                                             
       sugar}                    => {whole milk}       0.001220132  1.0000000 0.001220132  3.913649    12
[7]   {rice,                                                                                             
       bottled water}            => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[8]   {canned fish,                                                                                      
       hygiene articles}         => {whole milk}       0.001118454  1.0000000 0.001118454  3.913649    11
[9]   {grapes,                                                                                           
       onions}                   => {other vegetables} 0.001118454  0.9166667 0.001220132  4.737476    11
[10]  {hard cheese,                                                                                      
       oil}                      => {other vegetables} 0.001118454  0.9166667 0.001220132  4.737476    11
[11]  {root vegetables,                                                                                  
       butter,                                                                                           
       rice}                     => {whole milk}       0.001016777  1.0000000 0.001016777  3.913649    10
[12]  {herbs,                                                                                            
       whole milk,                                                                                       
       fruit/vegetable juice}    => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[13]  {citrus fruit,                                                                                     
       tropical fruit,                                                                                   
       herbs}                    => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[14]  {root vegetables,                                                                                  
       whipped/sour cream,                                                                               
       flour}                    => {whole milk}       0.001728521  1.0000000 0.001728521  3.913649    17
[15]  {butter,                                                                                           
       soft cheese,                                                                                      
       domestic eggs}            => {whole milk}       0.001016777  1.0000000 0.001016777  3.913649    10
[16]  {tropical fruit,                                                                                   
       whipped/sour cream,                                                                               
       soft cheese}              => {other vegetables} 0.001220132  0.9230769 0.001321810  4.770605    12
[17]  {root vegetables,                                                                                  
       whipped/sour cream,                                                                               
       soft cheese}              => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[18]  {citrus fruit,                                                                                     
       root vegetables,                                                                                  
       soft cheese}              => {other vegetables} 0.001016777  1.0000000 0.001016777  5.168156    10
[19]  {frankfurter,                                                                                      
       tropical fruit,                                                                                   
       frozen meals}             => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[20]  {frankfurter,                                                                                      
       tropical fruit,                                                                                   
       frozen meals}             => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[21]  {tropical fruit,                                                                                   
       butter,                                                                                           
       frozen meals}             => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[22]  {tropical fruit,                                                                                   
       whipped/sour cream,                                                                               
       hard cheese}              => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[23]  {pork,                                                                                             
       whole milk,                                                                                       
       butter milk}              => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[24]  {pip fruit,                                                                                        
       butter milk,                                                                                      
       fruit/vegetable juice}    => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[25]  {frankfurter,                                                                                      
       root vegetables,                                                                                  
       sliced cheese}            => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[26]  {butter,                                                                                           
       whipped/sour cream,                                                                               
       sliced cheese}            => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[27]  {yogurt,                                                                                           
       oil,                                                                                              
       coffee}                   => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[28]  {root vegetables,                                                                                  
       onions,                                                                                           
       napkins}                  => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[29]  {sausage,                                                                                          
       berries,                                                                                          
       butter}                   => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[30]  {hamburger meat,                                                                                   
       tropical fruit,                                                                                   
       whipped/sour cream}       => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[31]  {butter,                                                                                           
       hygiene articles,                                                                                 
       napkins}                  => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[32]  {pip fruit,                                                                                        
       butter,                                                                                           
       hygiene articles}         => {whole milk}       0.001016777  1.0000000 0.001016777  3.913649    10
[33]  {tropical fruit,                                                                                   
       butter,                                                                                           
       hygiene articles}         => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[34]  {tropical fruit,                                                                                   
       domestic eggs,                                                                                    
       hygiene articles}         => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[35]  {root vegetables,                                                                                  
       whipped/sour cream,                                                                               
       hygiene articles}         => {whole milk}       0.001016777  1.0000000 0.001016777  3.913649    10
[36]  {pip fruit,                                                                                        
       root vegetables,                                                                                  
       hygiene articles}         => {whole milk}       0.001016777  1.0000000 0.001016777  3.913649    10
[37]  {cream cheese ,                                                                                    
       domestic eggs,                                                                                    
       sugar}                    => {whole milk}       0.001118454  1.0000000 0.001118454  3.913649    11
[38]  {other vegetables,                                                                                 
       cream cheese ,                                                                                    
       sugar}                    => {whole milk}       0.001525165  0.9375000 0.001626843  3.669046    15
[39]  {curd,                                                                                             
       domestic eggs,                                                                                    
       sugar}                    => {whole milk}       0.001016777  1.0000000 0.001016777  3.913649    10
[40]  {citrus fruit,                                                                                     
       domestic eggs,                                                                                    
       sugar}                    => {whole milk}       0.001423488  0.9333333 0.001525165  3.652739    14
[41]  {tropical fruit,                                                                                   
       domestic eggs,                                                                                    
       sugar}                    => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[42]  {yogurt,                                                                                           
       domestic eggs,                                                                                    
       sugar}                    => {whole milk}       0.001423488  0.9333333 0.001525165  3.652739    14
[43]  {root vegetables,                                                                                  
       whipped/sour cream,                                                                               
       sugar}                    => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[44]  {pork,                                                                                             
       rolls/buns,                                                                                       
       waffles}                  => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[45]  {whipped/sour cream,                                                                               
       long life bakery product,                                                                         
       napkins}                  => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[46]  {tropical fruit,                                                                                   
       long life bakery product,                                                                         
       napkins}                  => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[47]  {sausage,                                                                                          
       butter,                                                                                           
       long life bakery product} => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[48]  {tropical fruit,                                                                                   
       dessert,                                                                                          
       whipped/sour cream}       => {other vegetables} 0.001118454  0.9166667 0.001220132  4.737476    11
[49]  {cream cheese ,                                                                                    
       domestic eggs,                                                                                    
       napkins}                  => {whole milk}       0.001118454  1.0000000 0.001118454  3.913649    11
[50]  {root vegetables,                                                                                  
       butter,                                                                                           
       cream cheese }            => {yogurt}           0.001016777  0.9090909 0.001118454  6.516698    10
[51]  {root vegetables,                                                                                  
       butter,                                                                                           
       cream cheese }            => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[52]  {pip fruit,                                                                                        
       whipped/sour cream,                                                                               
       cream cheese }            => {whole milk}       0.001321810  0.9285714 0.001423488  3.634103    13
[53]  {sausage,                                                                                          
       pip fruit,                                                                                        
       cream cheese }            => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[54]  {citrus fruit,                                                                                     
       root vegetables,                                                                                  
       cream cheese }            => {other vegetables} 0.001220132  0.9230769 0.001321810  4.770605    12
[55]  {root vegetables,                                                                                  
       butter,                                                                                           
       white bread}              => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[56]  {butter,                                                                                           
       whipped/sour cream,                                                                               
       coffee}                   => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[57]  {root vegetables,                                                                                  
       domestic eggs,                                                                                    
       coffee}                   => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[58]  {butter,                                                                                           
       curd,                                                                                             
       domestic eggs}            => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[59]  {citrus fruit,                                                                                     
       butter,                                                                                           
       curd}                     => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[60]  {domestic eggs,                                                                                    
       margarine,                                                                                        
       bottled beer}             => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[61]  {pip fruit,                                                                                        
       whipped/sour cream,                                                                               
       brown bread}              => {other vegetables} 0.001118454  1.0000000 0.001118454  5.168156    11
[62]  {domestic eggs,                                                                                    
       margarine,                                                                                        
       fruit/vegetable juice}    => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[63]  {pip fruit,                                                                                        
       butter,                                                                                           
       whipped/sour cream}       => {whole milk}       0.001830198  0.9000000 0.002033554  3.522284    18
[64]  {butter,                                                                                           
       whipped/sour cream,                                                                               
       soda}                     => {other vegetables} 0.001321810  0.9285714 0.001423488  4.799002    13
[65]  {pip fruit,                                                                                        
       butter,                                                                                           
       pastry}                   => {other vegetables} 0.001321810  0.9285714 0.001423488  4.799002    13
[66]  {tropical fruit,                                                                                   
       whipped/sour cream,                                                                               
       domestic eggs}            => {whole milk}       0.001830198  0.9000000 0.002033554  3.522284    18
[67]  {tropical fruit,                                                                                   
       whipped/sour cream,                                                                               
       fruit/vegetable juice}    => {other vegetables} 0.001931876  0.9047619 0.002135231  4.675950    19
[68]  {root vegetables,                                                                                  
       other vegetables,                                                                                 
       yogurt,                                                                                           
       rice}                     => {whole milk}       0.001321810  0.9285714 0.001423488  3.634103    13
[69]  {root vegetables,                                                                                  
       whole milk,                                                                                       
       yogurt,                                                                                           
       rice}                     => {other vegetables} 0.001321810  0.9285714 0.001423488  4.799002    13
[70]  {tropical fruit,                                                                                   
       root vegetables,                                                                                  
       herbs,                                                                                            
       other vegetables}         => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[71]  {tropical fruit,                                                                                   
       grapes,                                                                                           
       whole milk,                                                                                       
       yogurt}                   => {other vegetables} 0.001016777  1.0000000 0.001016777  5.168156    10
[72]  {tropical fruit,                                                                                   
       pip fruit,                                                                                        
       yogurt,                                                                                           
       frozen meals}             => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[73]  {root vegetables,                                                                                  
       other vegetables,                                                                                 
       yogurt,                                                                                           
       hard cheese}              => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[74]  {ham,                                                                                              
       tropical fruit,                                                                                   
       pip fruit,                                                                                        
       yogurt}                   => {other vegetables} 0.001016777  1.0000000 0.001016777  5.168156    10
[75]  {ham,                                                                                              
       tropical fruit,                                                                                   
       pip fruit,                                                                                        
       whole milk}               => {other vegetables} 0.001118454  1.0000000 0.001118454  5.168156    11
[76]  {tropical fruit,                                                                                   
       butter,                                                                                           
       yogurt,                                                                                           
       sliced cheese}            => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[77]  {tropical fruit,                                                                                   
       whole milk,                                                                                       
       butter,                                                                                           
       sliced cheese}            => {yogurt}           0.001016777  0.9090909 0.001118454  6.516698    10
[78]  {tropical fruit,                                                                                   
       root vegetables,                                                                                  
       yogurt,                                                                                           
       oil}                      => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[79]  {tropical fruit,                                                                                   
       root vegetables,                                                                                  
       yogurt,                                                                                           
       oil}                      => {whole milk}       0.001118454  1.0000000 0.001118454  3.913649    11
[80]  {root vegetables,                                                                                  
       other vegetables,                                                                                 
       yogurt,                                                                                           
       oil}                      => {whole milk}       0.001423488  1.0000000 0.001423488  3.913649    14
[81]  {root vegetables,                                                                                  
       whole milk,                                                                                       
       yogurt,                                                                                           
       oil}                      => {other vegetables} 0.001423488  0.9333333 0.001525165  4.823612    14
[82]  {root vegetables,                                                                                  
       other vegetables,                                                                                 
       yogurt,                                                                                           
       waffles}                  => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[83]  {other vegetables,                                                                                 
       curd,                                                                                             
       whipped/sour cream,                                                                               
       cream cheese }            => {yogurt}           0.001016777  0.9090909 0.001118454  6.516698    10
[84]  {citrus fruit,                                                                                     
       whole milk,                                                                                       
       whipped/sour cream,                                                                               
       cream cheese }            => {other vegetables} 0.001118454  0.9166667 0.001220132  4.737476    11
[85]  {pip fruit,                                                                                        
       root vegetables,                                                                                  
       other vegetables,                                                                                 
       cream cheese }            => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[86]  {pip fruit,                                                                                        
       other vegetables,                                                                                 
       yogurt,                                                                                           
       cream cheese }            => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[87]  {tropical fruit,                                                                                   
       butter,                                                                                           
       yogurt,                                                                                           
       white bread}              => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[88]  {tropical fruit,                                                                                   
       other vegetables,                                                                                 
       butter,                                                                                           
       white bread}              => {yogurt}           0.001016777  0.9090909 0.001118454  6.516698    10
[89]  {root vegetables,                                                                                  
       other vegetables,                                                                                 
       butter,                                                                                           
       white bread}              => {whole milk}       0.001016777  1.0000000 0.001016777  3.913649    10
[90]  {root vegetables,                                                                                  
       whole milk,                                                                                       
       butter,                                                                                           
       white bread}              => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[91]  {citrus fruit,                                                                                     
       other vegetables,                                                                                 
       yogurt,                                                                                           
       frozen vegetables}        => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[92]  {beef,                                                                                             
       tropical fruit,                                                                                   
       yogurt,                                                                                           
       rolls/buns}               => {whole milk}       0.001321810  0.9285714 0.001423488  3.634103    13
[93]  {tropical fruit,                                                                                   
       curd,                                                                                             
       yogurt,                                                                                           
       domestic eggs}            => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[94]  {citrus fruit,                                                                                     
       tropical fruit,                                                                                   
       curd,                                                                                             
       yogurt}                   => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[95]  {other vegetables,                                                                                 
       butter,                                                                                           
       whipped/sour cream,                                                                               
       napkins}                  => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[96]  {pork,                                                                                             
       other vegetables,                                                                                 
       butter,                                                                                           
       whipped/sour cream}       => {whole milk}       0.001016777  1.0000000 0.001016777  3.913649    10
[97]  {pork,                                                                                             
       root vegetables,                                                                                  
       other vegetables,                                                                                 
       butter}                   => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[98]  {frankfurter,                                                                                      
       tropical fruit,                                                                                   
       root vegetables,                                                                                  
       yogurt}                   => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[99]  {pip fruit,                                                                                        
       root vegetables,                                                                                  
       other vegetables,                                                                                 
       brown bread}              => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[100] {root vegetables,                                                                                  
       other vegetables,                                                                                 
       rolls/buns,                                                                                       
       brown bread}              => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[101] {other vegetables,                                                                                 
       butter,                                                                                           
       whipped/sour cream,                                                                               
       domestic eggs}            => {whole milk}       0.001220132  1.0000000 0.001220132  3.913649    12
[102] {tropical fruit,                                                                                   
       butter,                                                                                           
       yogurt,                                                                                           
       domestic eggs}            => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[103] {root vegetables,                                                                                  
       butter,                                                                                           
       yogurt,                                                                                           
       domestic eggs}            => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[104] {tropical fruit,                                                                                   
       butter,                                                                                           
       whipped/sour cream,                                                                               
       fruit/vegetable juice}    => {other vegetables} 0.001016777  1.0000000 0.001016777  5.168156    10
[105] {whole milk,                                                                                       
       butter,                                                                                           
       whipped/sour cream,                                                                               
       soda}                     => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[106] {citrus fruit,                                                                                     
       other vegetables,                                                                                 
       butter,                                                                                           
       bottled water}            => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[107] {whole milk,                                                                                       
       rolls/buns,                                                                                       
       soda,                                                                                             
       newspapers}               => {other vegetables} 0.001016777  1.0000000 0.001016777  5.168156    10
[108] {pip fruit,                                                                                        
       other vegetables,                                                                                 
       whipped/sour cream,                                                                               
       domestic eggs}            => {whole milk}       0.001220132  0.9230769 0.001321810  3.612599    12
[109] {citrus fruit,                                                                                     
       whole milk,                                                                                       
       whipped/sour cream,                                                                               
       domestic eggs}            => {other vegetables} 0.001220132  0.9230769 0.001321810  4.770605    12
[110] {tropical fruit,                                                                                   
       yogurt,                                                                                           
       whipped/sour cream,                                                                               
       domestic eggs}            => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[111] {tropical fruit,                                                                                   
       other vegetables,                                                                                 
       whipped/sour cream,                                                                               
       domestic eggs}            => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[112] {citrus fruit,                                                                                     
       tropical fruit,                                                                                   
       other vegetables,                                                                                 
       domestic eggs}            => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[113] {tropical fruit,                                                                                   
       yogurt,                                                                                           
       whipped/sour cream,                                                                               
       fruit/vegetable juice}    => {other vegetables} 0.001118454  0.9166667 0.001220132  4.737476    11
[114] {tropical fruit,                                                                                   
       whole milk,                                                                                       
       whipped/sour cream,                                                                               
       fruit/vegetable juice}    => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[115] {pip fruit,                                                                                        
       root vegetables,                                                                                  
       yogurt,                                                                                           
       fruit/vegetable juice}    => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[116] {citrus fruit,                                                                                     
       other vegetables,                                                                                 
       soda,                                                                                             
       fruit/vegetable juice}    => {root vegetables}  0.001016777  0.9090909 0.001118454  8.340400    10
[117] {citrus fruit,                                                                                     
       whipped/sour cream,                                                                               
       rolls/buns,                                                                                       
       pastry}                   => {whole milk}       0.001016777  1.0000000 0.001016777  3.913649    10
[118] {citrus fruit,                                                                                     
       tropical fruit,                                                                                   
       root vegetables,                                                                                  
       whipped/sour cream}       => {other vegetables} 0.001220132  1.0000000 0.001220132  5.168156    12
[119] {pip fruit,                                                                                        
       root vegetables,                                                                                  
       other vegetables,                                                                                 
       bottled water}            => {whole milk}       0.001118454  1.0000000 0.001118454  3.913649    11
[120] {tropical fruit,                                                                                   
       root vegetables,                                                                                  
       yogurt,                                                                                           
       pastry}                   => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[121] {sausage,                                                                                          
       tropical fruit,                                                                                   
       root vegetables,                                                                                  
       yogurt}                   => {whole milk}       0.001525165  0.9375000 0.001626843  3.669046    15
[122] {sausage,                                                                                          
       tropical fruit,                                                                                   
       root vegetables,                                                                                  
       rolls/buns}               => {whole milk}       0.001016777  1.0000000 0.001016777  3.913649    10
[123] {tropical fruit,                                                                                   
       root vegetables,                                                                                  
       rolls/buns,                                                                                       
       bottled water}            => {whole milk}       0.001118454  0.9166667 0.001220132  3.587512    11
[124] {tropical fruit,                                                                                   
       root vegetables,                                                                                  
       other vegetables,                                                                                 
       yogurt,                                                                                           
       oil}                      => {whole milk}       0.001016777  1.0000000 0.001016777  3.913649    10
[125] {tropical fruit,                                                                                   
       root vegetables,                                                                                  
       whole milk,                                                                                       
       yogurt,                                                                                           
       oil}                      => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[126] {tropical fruit,                                                                                   
       other vegetables,                                                                                 
       whole milk,                                                                                       
       yogurt,                                                                                           
       oil}                      => {root vegetables}  0.001016777  0.9090909 0.001118454  8.340400    10
[127] {tropical fruit,                                                                                   
       other vegetables,                                                                                 
       butter,                                                                                           
       yogurt,                                                                                           
       domestic eggs}            => {whole milk}       0.001016777  0.9090909 0.001118454  3.557863    10
[128] {citrus fruit,                                                                                     
       root vegetables,                                                                                  
       whole milk,                                                                                       
       yogurt,                                                                                           
       whipped/sour cream}       => {other vegetables} 0.001016777  0.9090909 0.001118454  4.698323    10
[129] {citrus fruit,                                                                                     
       tropical fruit,                                                                                   
       root vegetables,                                                                                  
       whole milk,                                                                                       
       yogurt}                   => {other vegetables} 0.001423488  0.9333333 0.001525165  4.823612    14

What Users are saying..

profile image

Anand Kumpatla

Sr Data Scientist @ Doubleslash Software Solutions Pvt Ltd
linkedin profile url

ProjectPro is a unique platform and helps many people in the industry to solve real-life problems with a step-by-step walkthrough of projects. A platform with some fantastic resources to gain... Read More

Relevant Projects

End-to-End Speech Emotion Recognition Project using ANN
Speech Emotion Recognition using RAVDESS Audio Dataset - Build an Artificial Neural Network Model to Classify Audio Data into various Emotions like Sad, Happy, Angry, and Neutral

FEAST Feature Store Example for Scaling Machine Learning
FEAST Feature Store Example- Learn to use FEAST Feature Store to manage, store, and discover features for customer churn prediction machine learning project.

Machine Learning Project to Forecast Rossmann Store Sales
In this machine learning project you will work on creating a robust prediction model of Rossmann's daily sales using store, promotion, and competitor data.

Build ARCH and GARCH Models in Time Series using Python
In this Project we will build an ARCH and a GARCH model using Python

Mastering A/B Testing: A Practical Guide for Production
In this A/B Testing for Machine Learning Project, you will gain hands-on experience in conducting A/B tests, analyzing statistical significance, and understanding the challenges of building a solution for A/B testing in a production environment.

Insurance Pricing Forecast Using XGBoost Regressor
In this project, we are going to talk about insurance forecast by using linear and xgboost regression techniques.

CycleGAN Implementation for Image-To-Image Translation
In this GAN Deep Learning Project, you will learn how to build an image to image translation model in PyTorch with Cycle GAN.

Build a Speech-Text Transcriptor with Nvidia Quartznet Model
In this Deep Learning Project, you will leverage transfer learning from Nvidia QuartzNet pre-trained models to develop a speech-to-text transcriptor.

Build a Logistic Regression Model in Python from Scratch
Regression project to implement logistic regression in python from scratch on streaming app data.

Isolation Forest Model and LOF for Anomaly Detection in Python
Credit Card Fraud Detection Project - Build an Isolation Forest Model and Local Outlier Factor (LOF) in Python to identify fraudulent credit card transactions.