#load library
if (!require("knitr")) install.packages("knitr")
if (!require("tidyverse")) install.packages("tidyverse")
if (!require("kableExtra")) install.packages("kableExtra")
if (!require("dplyr")) install.packages("dplyr")
if (!require("Matrix")) install.packages("Matrix")
if (!require("recommenderlab")) install.packages("recommenderlab")
if (!require("gridExtra")) install.packages("gridExtra")
if (!require("graphics")) install.packages("graphics")I am going to build an ALS based recommender system. ALS recommender is a matrix factorization algorithm in Collaborative Filtering that uses Alternating Least Squares
I use MovieLens full datasets: 25M movie ratings. Stable benchmark dataset. 25 million ratings and one million tag applications applied to 62,000 movies by 162,000 users. Includes tag genome data with 15 million relevance scores across 1,129 tags. Released 12/2019
Further Information About GroupLens
GroupLens is a research group in the Department of Computer Science and Engineering at the University of Minnesota. Since its inception in 1992, GroupLens’s research projects have explored a variety of fields including:
GroupLens Research operates a movie recommender based on collaborative filtering, MovieLens, which is the source of these data. We encourage you to visit http://movielens.org to try it out! If you have exciting ideas for experimental work to conduct on MovieLens, send us an email at grouplens-info@cs.umn.edu - we are always interested in working with external collaborators.
ratings_data <- read.csv('ratings.csv', stringsAsFactors = F)
movie_data <- read.csv('movies.csv', stringsAsFactors = F)
tags_data <- read.csv('tags.csv', stringsAsFactors = F)
links_data <- read.csv('links.csv', stringsAsFactors = F)#Load results
head(ratings_data) %>% kable()%>%
kable_styling(bootstrap_options = "striped", full_width = F)| userId | movieId | rating | timestamp |
|---|---|---|---|
| 1 | 1 | 4 | 964982703 |
| 1 | 3 | 4 | 964981247 |
| 1 | 6 | 4 | 964982224 |
| 1 | 47 | 5 | 964983815 |
| 1 | 50 | 5 | 964982931 |
| 1 | 70 | 3 | 964982400 |
| movieId | title | genres |
|---|---|---|
| 1 | Toy Story (1995) | Adventure|Animation|Children|Comedy|Fantasy |
| 2 | Jumanji (1995) | Adventure|Children|Fantasy |
| 3 | Grumpier Old Men (1995) | Comedy|Romance |
| 4 | Waiting to Exhale (1995) | Comedy|Drama|Romance |
| 5 | Father of the Bride Part II (1995) | Comedy |
| 6 | Heat (1995) | Action|Crime|Thriller |
| userId | movieId | tag | timestamp |
|---|---|---|---|
| 2 | 60756 | funny | 1445714994 |
| 2 | 60756 | Highly quotable | 1445714996 |
| 2 | 60756 | will ferrell | 1445714992 |
| 2 | 89774 | Boxing story | 1445715207 |
| 2 | 89774 | MMA | 1445715200 |
| 2 | 89774 | Tom Hardy | 1445715205 |
| movieId | imdbId | tmdbId |
|---|---|---|
| 1 | 114709 | 862 |
| 2 | 113497 | 8844 |
| 3 | 113228 | 15602 |
| 4 | 114885 | 31357 |
| 5 | 113041 | 11862 |
| 6 | 113277 | 949 |
Determining the recommendation techniques which achieved highest accuracy.