Book Image

R Data Science Essentials

Book Image

R Data Science Essentials

Overview of this book

With organizations increasingly embedding data science across their enterprise and with management becoming more data-driven it is an urgent requirement for analysts and managers to understand the key concept of data science. The data science concepts discussed in this book will help you make key decisions and solve the complex problems you will inevitably face in this new world. R Data Science Essentials will introduce you to various important concepts in the field of data science using R. We start by reading data from multiple sources, then move on to processing the data, extracting hidden patterns, building predictive and forecasting models, building a recommendation engine, and communicating to the user through stunning visualizations and dashboards. By the end of this book, you will have an understanding of some very important techniques in data science, be able to implement them using R, understand and interpret the outcomes, and know how they helps businesses make a decision.
Table of Contents (15 chapters)
R Data Science Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Apriori sequence analysis


Apriori sequence analysis is a technique that looks out for the statistically significant patterns in the sequence of the data. It is widely used in shopping use cases—we can predict what will be the likeliest next purchase on knowing the purchase of an item by a customer.

We can implement the Apriori sequence algorithm in R using the cspade function. In the following code, we filter the rules with support more than 0.55 alone:

seq_rules<- cspade(zaki, parameter = list(support = 0.55), control   = list(verbose=TRUE))

The output is as follows:

The preceding output will generate the rules based on the parameters specified. To learn about using other parameters, refer to the documentation of the packages at https://cran.r-project.org/web/packages/arulesSequences/arulesSequences.pdf.