Book Image

R Data Analysis Projects

By : Gopi Subramanian
Book Image

R Data Analysis Projects

By: Gopi Subramanian

Overview of this book

R offers a large variety of packages and libraries for fast and accurate data analysis and visualization. As a result, it’s one of the most popularly used languages by data scientists and analysts, or anyone who wants to perform data analysis. This book will demonstrate how you can put to use your existing knowledge of data analysis in R to build highly efficient, end-to-end data analysis pipelines without any hassle. You’ll start by building a content-based recommendation system, followed by building a project on sentiment analysis with tweets. You’ll implement time-series modeling for anomaly detection, and understand cluster analysis of streaming data. You’ll work through projects on performing efficient market data research, building recommendation systems, and analyzing networks accurately, all provided with easy to follow codes. With the help of these real-world projects, you’ll get a better understanding of the challenges faced when building data analysis pipelines, and see how you can overcome them without compromising on the efficiency or accuracy of your systems. The book covers some popularly used R packages such as dplyr, ggplot2, RShiny, and others, and includes tips on using them effectively. By the end of this book, you’ll have a better understanding of data analysis with R, and be able to put your knowledge to practical use without any hassle.
Table of Contents (9 chapters)

Designing and implementing collaborative filtering

We now have a good overview of the recommenderlab package and our Jester5k data. Our use case is to design a recommendation system for suggesting jokes to the users. We want to suggest to users the jokes they have either not seen or rated before. Let us begin with outlining the steps in our project.

The steps in designing our recommendation project are shown in the following figure:

Ratings matrix

The first step is to obtain the ratings matrix. The recommenderlab expects the user rating matrix to be stored as either binaryRatingsMatrix or realRatingsMatrix.

The realRatingsmatrix s3 class has a slot called data where the actual ratings matrix is stored in a compressed...