Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
R Data Science Essentials

You're reading from  R Data Science Essentials

Product type Book
Published in Jan 2016
Publisher
ISBN-13 9781785286544
Pages 154 pages
Edition 1st Edition
Languages

Table of Contents (15) Chapters

R Data Science Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Getting Started with R Exploratory Data Analysis Pattern Discovery Segmentation Using Clustering Developing Regression Models Time Series Forecasting Recommendation Engine Communicating Data Analysis Index

Dataset and transformation


In this chapter, we will use the dataset that was used in the Chapter 3, Pattern Discovery. This dataset has two columns, namely the userID and items. We will consider that the UserID column represents the users and the Items column represents the products purchased by the user.

Let's have a look at the dataset by reading the dataset to the R environment:

# reading the dataset
rdata <- read.csv("Data/following.csv")
head(rdata, 10)

The output of the preceding code is as follows:

Now, based on the purchase history of all the users, we need to recommend the products that the user might be interested in buying. This can be done by first identifying the similar users and then extracting the new products from the most similar users. We will get into the details of this approach in this chapter.

First of all, in order to build a recommendation system, we need to alter the dataset to a matrix in such a fashion that the items become the row names and the user ID will become...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}