Skip to Content
Machine Learning with R Cookbook - Second Edition
book

Machine Learning with R Cookbook - Second Edition

by AshishSingh Bhatia, Yu-Wei, Chiu (David Chiu)
October 2017
Beginner to intermediate content levelBeginner to intermediate
572 pages
26h 1m
English
Packt Publishing
Content preview from Machine Learning with R Cookbook - Second Edition

How to do it...

Perform the following steps to analyze the association rules:

  1. First, you need to load the Groceries dataset:
        > data(Groceries)  
  1. You can then examine the summary of the Groceries dataset:
        > summary(Groceries)  
  1. Next, you can use itemFrequencyPlot to examine the relative item frequency of itemsets:
        > itemFrequencyPlot(Groceries, support = 0.1, cex.names=0.8,        topN=5) 
The top five item frequency bar plot of groceries transactions
  1. Use apriori to discover rules with support over 0.001 and confidence over 0.5:
        > rules = apriori(Groceries, parameter = list(supp = 0.001, conf = 0.5, target= "rules")) > summary(rules) Output ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Machine Learning Using R

Machine Learning Using R

Karthik Ramasubramanian, Abhishek Singh
Practical Machine Learning in R

Practical Machine Learning in R

Fred Nwanganga, Mike Chapple
Learning Bayesian Models with R

Learning Bayesian Models with R

Hari Manassery Koduvely

Publisher Resources

ISBN: 9781787284395Supplemental Content