Skip to Content
R Deep Learning Essentials - Second Edition
book

R Deep Learning Essentials - Second Edition

by Mark Hodnett, Joshua F. Wiley
August 2018
Intermediate to advanced
378 pages
9h 9m
English
Packt Publishing
Content preview from R Deep Learning Essentials - Second Edition

Building a collaborative filtering model

Before we jump into applying a deep learning model, we should follow the same practice as we have done in previous chapters and create a benchmark accuracy score using a standard machine learning algorithm. It is quick, easy, and will give us confidence that our deep learning model is working better than just using normal machine learning. Here are the 20 lines of code to do collaborative filtering in R. This code can be found in Chapter8/ml_recommend.R:

library(readr)library(recommenderlab)library(reshape2)set.seed(42)in_file <- "../dunnhumby/recommend.csv"df <- read_csv(in_file)dfPivot <-dcast(df, cust_id ~ prod_id)m <- as.matrix(dfPivot[,2:ncol(dfPivot)])recommend <- as(m,"realRatingMatrix")e <- ...
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

R Deep Learning Cookbook

R Deep Learning Cookbook

PKS Prakash, Achyutuni Sri Krishna Rao
Hands-On Deep Learning with R

Hands-On Deep Learning with R

Rodger Devine, Michael Pawlus
R: Unleash Machine Learning Techniques

R: Unleash Machine Learning Techniques

Raghav Bali, Dipanjan Sarkar, Brett Lantz, Cory Lesmeister
Deep Learning with R Cookbook

Deep Learning with R Cookbook

Swarna Gupta, Rehan Ali Ansari, Dipayan Sarkar

Publisher Resources

ISBN: 9781788992893Supplemental Content