August 2017
Intermediate to advanced
288 pages
8h 6m
English
This recipe covers the steps for setting up collaborative filtering using an RBM.
txt <- readLines("movies.dat", encoding = "latin1") txt_split <- lapply(strsplit(txt, "::"), function(x) as.data.frame(t(x), stringsAsFactors=FALSE)) movies_df <- do.call(rbind, txt_split) names(movies_df) <- c("MovieID", "Title", "Genres") movies_df$MovieID <- as.numeric(movies_df$MovieID)
movies_df$id_order <- 1:nrow(movies_df)
ratings_df <- read.table("ratings.dat", sep=":",header=FALSE,stringsAsFactors = F)