Project 3 | Matrix Factorization methods

Project Objectives

The goal of this assignment is give you practice working with Matrix Factorization techniques. Your task is implement a matrix factorization method—such as singular value decomposition (SVD) or Alternating Least Squares (ALS)—in the context of a recommender system. You may approach this assignment in a number of ways. You are welcome to start with an existing recommender system written by yourself or someone else. Remember as always to cite your sources, so that you can be graded on what you added, not what you found. SVD can be thought of as a pre-processing step for feature engineering. You might easily start with thousands or millions of items, and use SVD to create a much smaller set of “k” items (e.g. 20 or 70).

Notes/Limitations:

• SVD builds features that may or may not map neatly to items (such as movie genres or news topics). As in many areas of machine learning, the lack of explainability can be an issue).
• SVD requires that there are no missing values. There are various ways to handle this, including (1) imputation of missing values, (2) mean-centering values around 0, or (3) using a more advance technique, such as stochastic gradient descent to simulate SVD in populating the factored matrices.
• Calculating the SVD matrices can be computationally expensive, although calculating ratings once the factorization is completed is very fast. You may need to create a subset of your data for SVD calculations to be successfully performed, especially on a machine with a small RAM footprint.

You may work in a small group. Please submit a link to your GitHub repository for your Jupyter notebook or RMarkdown file (and rpubs.com link).

Mathematical steps for SVD computation

We used the Project-2 of previous week, to build the Recommender system. But, we incorporated the SVD along the way. In order to explain the mathematics behind Single Value Decomposition, we’ll give a brief outline of the algorithm for SVD computation, along with an example.

  1. There is a well-known theorem that if \(A\) is any \(m×n\) matrix, there \(∃\) three matrices \(U\), \(Σ\) and \(V\) s.t. \(A=U.Σ.V^T\). Refer Theorem 10 (page 417)), in Linear Algebra and its Applications, 4th Edition, by David C. Lay.

     

  2. What is \(Σ\)?
    \(Σ = \begin{bmatrix} D & 0 \\ 0 & 0 \end{bmatrix}\), where \(D=\begin{bmatrix} { \sigma }_{ 1 } & ... & 0 \\ ... & ... & ... \\ 0 & ... & { \sigma }_{ r } \end{bmatrix}\), where \({ \sigma }_{ 1 },{ \sigma }_{ 2 },{ \sigma }_{ 3 }...{ \sigma }_{ r }\) are positive square roots of the Eigen Values of \({ A }^{ T }.A\).

     

  3. What are \(U\) and \(V\)?
    Columns of \(U\) will be LSV of \(A\), and columns of \(V\) will be RSV of \(A\).

     

  4. So, first compute \({ A }^{ T }.A\).

     

  5. Next, compute Eigen Values of \({ A }^{ T }.A\): \(\lambda _{ 1 },{ \lambda }_{ 2 },\lambda _{ 3 }......\lambda _{ r }\)

     

  6. Let’s, take square roots of the \(\lambda _{ 1 }\), and assign to \(\sigma _{ 1 }\):
    \(\sigma _{ 1 }=\sqrt { { \lambda }_{ 1 } } ,\quad \sigma _{ 2 }=\sqrt { { \lambda }_{ 2 } } ,\quad \sigma _{ 3 }=\sqrt { { \lambda }_{ 3 } } .....\quad \sigma _{ r }=\sqrt { { \lambda }_{ r } }\)

     

  7. Also, compute the Eigen Vectors of \({ A }^{ T }.A\): \(V={ v }_{ 1 },{ v }_{ 2 },.....{ v }_{ n }\). These will be the RSV of \(A\).

     

  8. Now, compute: \({ u }_{ 1 }=\frac { 1 }{ { \sigma }_{ 1 } } A{ v }_{ 1 },{ u }_{ 2 }=\frac { 1 }{ { \sigma }_{ 2 } } A{ v }_{ 2 },.....{ u }_{ r }=\frac { 1 }{ { \sigma }_{ r } } A{ v }_{ r }\).

     

  9. Then, \(D=\begin{bmatrix} \sqrt { { \lambda }_{ 1 } } & ... & 0 \\ ... & ... & ... \\ 0 & ... & \sqrt { { \lambda }_{ r } } \end{bmatrix}\)

     

  10. Finally, \(A=[{ u }_{ 1 }...{ u }_{ m }].Σ.{ [v_{ 1 }...{ v }_{ m }] }^{ T }\)

     

Math Example to implement the above outline

  1. We’ll perform SVD of matrix \(A=\begin{bmatrix} 1 & 2 & 3 \\ -1 & 0 & 4 \end{bmatrix}\)

     

  2. First, I’ll code matrix \(A\) and its transpose.
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]   -1    0    4
##      [,1] [,2]
## [1,]    1   -1
## [2,]    2    0
## [3,]    3    4
  1. Now, in order to compute \(X\) = \(A.{ A }^{ T }\) and \(Y\) = \({ A }^{ T }.A\), I’ll code a general purpose matrix multiplication function my_mat_mult(), in below code chunk.
  1. Computing \(X\) and \(Y\), by calling my_mat_mult().
##      [,1] [,2]
## [1,]   14   11
## [2,]   11   17
##      [,1] [,2] [,3]
## [1,]    2    2   -1
## [2,]    2    4    6
## [3,]   -1    6   25
  1. Computing eigenvectors and eigenvalues of \(X\) and \(Y\), by R’s built-in function eigen().
## eigen() decomposition
## $values
## [1] 26.601802  4.398198
## 
## $vectors
##           [,1]       [,2]
## [1,] 0.6576043 -0.7533635
## [2,] 0.7533635  0.6576043
## eigen() decomposition
## $values
## [1] 2.660180e+01 4.398198e+00 1.058982e-16
## 
## $vectors
##             [,1]       [,2]       [,3]
## [1,] -0.01856629 -0.6727903  0.7396003
## [2,]  0.25499937 -0.7184510 -0.6471502
## [3,]  0.96676296  0.1765824  0.1849001
  1. Now, I’ll do Single valued Decomposition (SVD) in the following code chunk, using R’s built-in function, svd().
## $d
## [1] 5.157693 2.097188
## 
## $u
##            [,1]       [,2]
## [1,] -0.6576043 -0.7533635
## [2,] -0.7533635  0.6576043
## 
## $v
##             [,1]       [,2]
## [1,]  0.01856629 -0.6727903
## [2,] -0.25499937 -0.7184510
## [3,] -0.96676296  0.1765824

Explanation: SVD_A contains the decomposed matrices of \(A\), namely \(A\), Sigma and V_transposed, in that order. Sigma contains a diagonal matrix in the top left, and zeros in the rest of the locations.

The column vectors of \(U\) are the left-singular vectors of \(A\). In the above results, observe the two columns vectors under $u.

The diagonal elements of D (top left in Sigma) are singular values of A. Note that they not vectors, because they are just elements of the diagonal matrix, D. In the above results, observe the two numbers under $d. 

The column vectors of \(V\) are the right-singular vectors of \(A\). In the above results, observe the two columns vectors $v.

Now, I’ll compare the left-singular vectors of \(A\) (i.e. \(U\) or $u), with the eigen vectors of \(X\). In comparison_table1, we observe that the two sets of vectors (without the signs) are equal each to each.

##      SVD_A_U_Col1 SVD_A_U_Col2  e_X_Col1   e_X_Col2
## [1,]   -0.6576043   -0.7533635 0.6576043 -0.7533635
## [2,]   -0.7533635    0.6576043 0.7533635  0.6576043
  1. In the following code chunk, I’ll compare the right-singular vectors of \(A\) (i.e. \(V\) or $v), with the eigen vectors of \(Y\). In this case, we know that while \(Y\) has 3 eigen vectors, \(V\) has 2 vectors. So, if we ignore the 3rd vector (column heading ‘IGNORE’), then the two sets of vectors (without signs) are equal, each to each.
##      SVD_A_V_Col1 SVD_A_V_Col2    e_Y_Col1   e_Y_Col2     IGNORE
## [1,]   0.01856629   -0.6727903 -0.01856629 -0.6727903  0.7396003
## [2,]  -0.25499937   -0.7184510  0.25499937 -0.7184510 -0.6471502
## [3,]  -0.96676296    0.1765824  0.96676296  0.1765824  0.1849001

Data Preparation and Exploration

We gathered data from section “recommended for education and development” of site https://grouplens.org/datasets/movielens/. This site provides two links, from which we chose the link for the smaller file, because the larger one (named as Full) is too large to load into github. Description of the data is as follows:

This dataset (ml-latest-small) describes 5-star rating and free-text tagging activity from MovieLens, a movie recommendation service. It contains 100836 ratings and 3683 tag applications across 9742 movies. These data were created by 610 users between March 29, 1996 and September 24, 2018. This dataset was generated on September 26, 2018. There are 4 *.csv files, from which we chose two files movies.cv and ratings.csv, for our down stream analysis.

Preview data

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
7 Sabrina (1995) Comedy|Romance
8 Tom and Huck (1995) Adventure|Children
9 Sudden Death (1995) Action
10 GoldenEye (1995) Action|Adventure|Thriller
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
1 101 5 964980868
1 110 4 964982176
1 151 5 964984041
1 157 5 964984100

Combine Data

Join movies with ratings on movieId

movieId userId rating timestamp title genres
1 1 4.0 964982703 Toy Story (1995) Adventure|Animation|Children|Comedy|Fantasy
1 555 4.0 978746159 Toy Story (1995) Adventure|Animation|Children|Comedy|Fantasy
1 232 3.5 1076955621 Toy Story (1995) Adventure|Animation|Children|Comedy|Fantasy
1 590 4.0 1258420408 Toy Story (1995) Adventure|Animation|Children|Comedy|Fantasy
1 601 4.0 1521467801 Toy Story (1995) Adventure|Animation|Children|Comedy|Fantasy
1 179 4.0 852114051 Toy Story (1995) Adventure|Animation|Children|Comedy|Fantasy
1 606 2.5 1349082950 Toy Story (1995) Adventure|Animation|Children|Comedy|Fantasy
1 328 5.0 1494210665 Toy Story (1995) Adventure|Animation|Children|Comedy|Fantasy
1 206 5.0 850763267 Toy Story (1995) Adventure|Animation|Children|Comedy|Fantasy
1 468 4.0 831400444 Toy Story (1995) Adventure|Animation|Children|Comedy|Fantasy

Create Matrix

As opposed to MovieLense of the recommenderlab, our dataset does not come as member of class realRatingMatrix. So, in the following code-chunk, we’ll create a realRatingMatrix dataset, called moviematrix. By putting moviematrix into class realRatingMatrix, we’ll be able to apply some useful functions on moviematrix (refer: page 33 of Building a Recommendation System with R).

## 610 x 9724 rating matrix of class 'realRatingMatrix' with 100836 ratings.

At this point, we’ll take stalk of the important characteristics of moviematrix.

## [1]  610 9724
##      user item rating
## 1       1    1      4
## 326     1    3      4
## 434     1    6      4
## 2108    1   47      5
## 2380    1   50      5
## 2860    1   70      3

Recommendation algorithms

Singular Value Decomposition Model(SVD Model)

Please note that parameter method = “SVD”, which performs the SVD. In below code-chunk, we performed a benchmark of the performance, using “tictoc” library.

##      RMSE       MSE       MAE 
## 0.9725093 0.9457744 0.7582130

Run-Time comparison

Run Time
UBCF Model - Training: 0.03 sec elapsed
UBCF Model - Predicting: 4.75 sec elapsed
SVD Model - Training: 2.19 sec elapsed
SVD Model - Predicting: 0.52 sec elapsed

We’ll observe that while UBCF Model’s training time is lesser than that of SVD Model, the prediction time of the latter is much lesser than that of the former.

Recommendations

Now we’ll predict the case of a particular user 596.

Movie Rating
Anaconda (1997) 1.0
Wild Wild West (1999) 1.5
Pearl Harbor (2001) 1.5
Daredevil (2003) 1.5
50 First Dates (2004) 1.5
Day After Tomorrow, The (2004) 1.5
Catwoman (2004) 1.5
X-Men: The Last Stand (2006) 1.5
Dante’s Peak (1997) 2.0
Batman & Robin (1997) 2.0
Tomorrow Never Dies (1997) 2.0
Godzilla (1998) 2.0
Superman IV: The Quest for Peace (1987) 2.0
Beach, The (2000) 2.0
Chicken Run (2000) 2.0
Dude, Where’s My Car? (2000) 2.0
Gangs of New York (2002) 2.0
Charlie and the Chocolate Factory (2005) 2.0
Ghost Rider: Spirit of Vengeance (2012) 2.0
Batman Forever (1995) 2.5
Saint, The (1997) 2.5
I Know What You Did Last Summer (1997) 2.5
Lost in Space (1998) 2.5
Deep Impact (1998) 2.5
You’ve Got Mail (1998) 2.5
She’s All That (1999) 2.5
Superman III (1983) 2.5
Teenage Mutant Ninja Turtles III (1993) 2.5
Mission: Impossible II (2000) 2.5
Gone in 60 Seconds (2000) 2.5
Perfect Storm, The (2000) 2.5
Scary Movie (2000) 2.5
What Women Want (2000) 2.5
Men in Black II (a.k.a. MIIB) (a.k.a. MIB 2) (2002) 2.5
Austin Powers in Goldmember (2002) 2.5
Signs (2002) 2.5
Terminator 3: Rise of the Machines (2003) 2.5
Troy (2004) 2.5
Million Dollar Baby (2004) 2.5
Elektra (2005) 2.5
Ultraviolet (2006) 2.5
Superman Returns (2006) 2.5
Blood Diamond (2006) 2.5
Spider-Man 3 (2007) 2.5
Fantastic Four: Rise of the Silver Surfer (2007) 2.5
X-Men Origins: Wolverine (2009) 2.5
Wolverine, The (2013) 2.5
The Amazing Spider-Man 2 (2014) 2.5
X-Men: Apocalypse (2016) 2.5
Guardians (2016) 2.5
Stonewall (2015) 2.5
Kingsman: The Golden Circle (2017) 2.5
Star Trek: Generations (1994) 3.0
Mask, The (1994) 3.0
Shadow, The (1994) 3.0
Terminator 2: Judgment Day (1991) 3.0
Godfather: Part II, The (1974) 3.0
Groundhog Day (1993) 3.0
Batman Returns (1992) 3.0
Donnie Brasco (1997) 3.0
My Best Friend’s Wedding (1997) 3.0
In & Out (1997) 3.0
Alien: Resurrection (1997) 3.0
Man in the Iron Mask, The (1998) 3.0
Wild Things (1998) 3.0
City of Angels (1998) 3.0
Dr. Dolittle (1998) 3.0
Rain Man (1988) 3.0
Antz (1998) 3.0
Babe: Pig in the City (1998) 3.0
Superman II (1980) 3.0
Better Than Chocolate (1999) 3.0
13th Warrior, The (1999) 3.0
Three Kings (1999) 3.0
Ferris Bueller’s Day Off (1986) 3.0
RoboCop (1987) 3.0
Whole Nine Yards, The (2000) 3.0
Teenage Mutant Ninja Turtles (1990) 3.0
Gladiator (2000) 3.0
Charlie’s Angels (2000) 3.0
Cast Away (2000) 3.0
A.I. Artificial Intelligence (2001) 3.0
Beautiful Mind, A (2001) 3.0
Blade II (2002) 3.0
Road to Perdition (2002) 3.0
Catch Me If You Can (2002) 3.0
Matrix Reloaded, The (2003) 3.0
Hulk (2003) 3.0
Pirates of the Caribbean: The Curse of the Black Pearl (2003) 3.0
League of Extraordinary Gentlemen, The (a.k.a. LXG) (2003) 3.0
Mambo Italiano (2003) 3.0
School of Rock (2003) 3.0
Mystic River (2003) 3.0
Chronicles of Riddick, The (2004) 3.0
Spider-Man 2 (2004) 3.0
Star Wars: Episode III - Revenge of the Sith (2005) 3.0
Fantastic Four (2005) 3.0
Casino Royale (2006) 3.0
Ghost Rider (2007) 3.0
Incredible Hulk, The (2008) 3.0
Milk (2008) 3.0
Curious Case of Benjamin Button, The (2008) 3.0
Inglourious Basterds (2009) 3.0
Law Abiding Citizen (2009) 3.0
Avatar (2009) 3.0
Iron Man 2 (2010) 3.0
Kids Are All Right, The (2010) 3.0
Social Network, The (2010) 3.0
True Grit (2010) 3.0
Amazing Spider-Man, The (2012) 3.0
Skyfall (2012) 3.0
Cloud Atlas (2012) 3.0
Star Trek Into Darkness (2013) 3.0
Man of Steel (2013) 3.0
Thor: The Dark World (2013) 3.0
X-Men: Days of Future Past (2014) 3.0
G.B.F. (2013) 3.0
Kingsman: The Secret Service (2015) 3.0
Man on High Heels (2014) 3.0
Avengers: Age of Ultron (2015) 3.0
Fantastic Four (2015) 3.0
Suicide Squad (2016) 3.0
Batman v Superman: Dawn of Justice (2016) 3.0
Beauty and the Beast (2017) 3.0
Twelve Monkeys (a.k.a. 12 Monkeys) (1995) 3.5
Usual Suspects, The (1995) 3.5
Birdcage, The (1996) 3.5
Apollo 13 (1995) 3.5
Adventures of Priscilla, Queen of the Desert, The (1994) 3.5
Forrest Gump (1994) 3.5
Fugitive, The (1993) 3.5
Philadelphia (1993) 3.5
Batman (1989) 3.5
Phenomenon (1996) 3.5
Godfather, The (1972) 3.5
Star Wars: Episode V - The Empire Strikes Back (1980) 3.5
Princess Bride, The (1987) 3.5
Raiders of the Lost Ark (Indiana Jones and the Raiders of the Lost Ark) (1981) 3.5
Aliens (1986) 3.5
Highlander (1986) 3.5
Indiana Jones and the Last Crusade (1989) 3.5
Field of Dreams (1989) 3.5
When Harry Met Sally… (1989) 3.5
Star Trek VI: The Undiscovered Country (1991) 3.5
Romy and Michele’s High School Reunion (1997) 3.5
Fifth Element, The (1997) 3.5
Hunt for Red October, The (1990) 3.5
Gattaca (1997) 3.5
X-Files: Fight the Future, The (1998) 3.5
Out of Sight (1998) 3.5
Breakfast Club, The (1985) 3.5
Rocketeer, The (1991) 3.5
Ever After: A Cinderella Story (1998) 3.5
Blade (1998) 3.5
Meet Joe Black (1998) 3.5
Faculty, The (1998) 3.5
October Sky (1999) 3.5
Superman (1978) 3.5
Mystery Men (1999) 3.5
Airplane! (1980) 3.5
Toy Story 2 (1999) 3.5
Green Mile, The (1999) 3.5
Pitch Black (2000) 3.5
Erin Brockovich (2000) 3.5
Shanghai Noon (2000) 3.5
Unbreakable (2000) 3.5
Chocolat (2000) 3.5
Miss Congeniality (2000) 3.5
O Brother, Where Art Thou? (2000) 3.5
Moulin Rouge (2001) 3.5
Monsters, Inc. (2001) 3.5
Harry Potter and the Sorcerer’s Stone (a.k.a. Harry Potter and the Philosopher’s Stone) (2001) 3.5
Ocean’s Eleven (2001) 3.5
Royal Tenenbaums, The (2001) 3.5
Ice Age (2002) 3.5
Spider-Man (2002) 3.5
Bourne Identity, The (2002) 3.5
Minority Report (2002) 3.5
Lord of the Rings: The Two Towers, The (2002) 3.5
Children’s Hour, The (1961) 3.5
Chicago (2002) 3.5
Kill Bill: Vol. 1 (2003) 3.5
Love Actually (2003) 3.5
Lord of the Rings: The Return of the King, The (2003) 3.5
Latter Days (2003) 3.5
Eternal Sunshine of the Spotless Mind (2004) 3.5
Hellboy (2004) 3.5
Kill Bill: Vol. 2 (2004) 3.5
Bourne Supremacy, The (2004) 3.5
Gia (1998) 3.5
Phantom of the Opera, The (2004) 3.5
D.E.B.S. (2004) 3.5
Sin City (2005) 3.5
Maidens in Uniform (Mädchen in Uniform) (1931) 3.5
Sky High (2005) 3.5
Harry Potter and the Goblet of Fire (2005) 3.5
Rent (2005) 3.5
C.R.A.Z.Y. (2005) 3.5
Breakfast on Pluto (2005) 3.5
Transamerica (2005) 3.5
Imagine Me & You (2005) 3.5
V for Vendetta (2006) 3.5
Harry Potter and the Order of the Phoenix (2007) 3.5
Itty Bitty Titty Committee (2007) 3.5
Iron Man (2008) 3.5
Watchmen (2009) 3.5
Burn After Reading (2008) 3.5
Dr. Horrible’s Sing-Along Blog (2008) 3.5
Were the World Mine (2008) 3.5
Up (2009) 3.5
Breakfast with Scot (2007) 3.5
Harry Potter and the Half-Blood Prince (2009) 3.5
Zombieland (2009) 3.5
Sherlock Holmes (2009) 3.5
Shutter Island (2010) 3.5
Kick-Ass (2010) 3.5
Toy Story 3 (2010) 3.5
Despicable Me (2010) 3.5
Scott Pilgrim vs. the World (2010) 3.5
Easy A (2010) 3.5
King’s Speech, The (2010) 3.5
Green Hornet, The (2011) 3.5
Source Code (2011) 3.5
Thor (2011) 3.5
X-Men: First Class (2011) 3.5
Beginners (2010) 3.5
Harry Potter and the Deathly Hallows: Part 2 (2011) 3.5
Avengers, The (2012) 3.5
Adventures of Tintin, The (2011) 3.5
Dark Knight Rises, The (2012) 3.5
Sherlock Holmes: A Game of Shadows (2011) 3.5
Prayers for Bobby (2009) 3.5
21 Jump Street (2012) 3.5
Pitch Perfect (2012) 3.5
Batman: The Dark Knight Returns, Part 1 (2012) 3.5
Hobbit: An Unexpected Journey, The (2012) 3.5
Misérables, Les (2012) 3.5
Frozen (2013) 3.5
The Lego Movie (2014) 3.5
Interstellar (2014) 3.5
Mission: Impossible - Rogue Nation (2015) 3.5
The Fault in Our Stars (2014) 3.5
Guardians of the Galaxy (2014) 3.5
The Hunger Games: Mockingjay - Part 1 (2014) 3.5
Justice League (2017) 3.5
Ant-Man (2015) 3.5
Captain America: Civil War (2016) 3.5
Doctor Strange (2016) 3.5
Marvel One-Shot: Item 47 (2012) 3.5
Girltrash: All Night Long (2014) 3.5
Fantastic Beasts and Where to Find Them (2016) 3.5
Sicario (2015) 3.5
The Danish Girl (2015) 3.5
Sherlock: The Abominable Bride (2016) 3.5
Jason Bourne (2016) 3.5
Miss Peregrine’s Home for Peculiar Children (2016) 3.5
While You Were Fighting: A Thor Mockumentary (2016) 3.5
Alien: Covenant (2017) 3.5
LEGO DC Super Hero Girls: Brain Drain (2017) 3.5
Murder on the Orient Express (2017) 3.5
Front Cover (2016) 3.5
Star Wars: The Last Jedi (2017) 3.5
Serving in Silence: The Margarethe Cammermeyer Story (1995) 3.5
The Purple Sea (2009) 3.5
Maze Runner: The Death Cure (2018) 3.5
Toy Story (1995) 4.0
Babe (1995) 4.0
Clueless (1995) 4.0
Star Wars: Episode IV - A New Hope (1977) 4.0
Lion King, The (1994) 4.0
Schindler’s List (1993) 4.0
Blade Runner (1982) 4.0
Celluloid Closet, The (1995) 4.0
Silence of the Lambs, The (1991) 4.0
Beauty and the Beast (1991) 4.0
Aristocats, The (1970) 4.0
Wizard of Oz, The (1939) 4.0
2001: A Space Odyssey (1968) 4.0
Mary Poppins (1964) 4.0
Sound of Music, The (1965) 4.0
Die Hard (1988) 4.0
Beautiful Thing (1996) 4.0
E.T. the Extra-Terrestrial (1982) 4.0
Monty Python and the Holy Grail (1975) 4.0
Star Wars: Episode VI - Return of the Jedi (1983) 4.0
Alien (1979) 4.0
Back to the Future (1985) 4.0
Star Trek II: The Wrath of Khan (1982) 4.0
Star Trek III: The Search for Spock (1984) 4.0
Star Trek IV: The Voyage Home (1986) 4.0
Good Will Hunting (1997) 4.0
Mulan (1998) 4.0
Little Mermaid, The (1989) 4.0
Star Trek: Insurrection (1998) 4.0
Cocoon (1985) 4.0
Matrix, The (1999) 4.0
Tarzan (1999) 4.0
Run Lola Run (Lola rennt) (1998) 4.0
Sixth Sense, The (1999) 4.0
Fight Club (1999) 4.0
Dogma (1999) 4.0
Maurice (1987) 4.0
Batman: Mask of the Phantasm (1993) 4.0
Boondock Saints, The (2000) 4.0
American Psycho (2000) 4.0
But I’m a Cheerleader (1999) 4.0
X-Men (2000) 4.0
Billy Elliot (2000) 4.0
Crouching Tiger, Hidden Dragon (Wo hu cang long) (2000) 4.0
Shrek (2001) 4.0
Atlantis: The Lost Empire (2001) 4.0
Amelie (Fabuleux destin d’Amélie Poulain, Le) (2001) 4.0
Lord of the Rings: The Fellowship of the Ring, The (2001) 4.0
Equilibrium (2002) 4.0
X2: X-Men United (2003) 4.0
Finding Nemo (2003) 4.0
28 Days Later (2002) 4.0
Matrix Revolutions, The (2003) 4.0
Incredibles, The (2004) 4.0
If These Walls Could Talk 2 (2000) 4.0
Battlestar Galactica (2003) 4.0
Batman Begins (2005) 4.0
Serenity (2005) 4.0
Corpse Bride (2005) 4.0
Brokeback Mountain (2005) 4.0
Kinky Boots (2005) 4.0
Prestige, The (2006) 4.0
Bourne Ultimatum, The (2007) 4.0
Dark Knight, The (2008) 4.0
Shelter (2007) 4.0
Nina’s Heavenly Delights (2006) 4.0
Kung Fu Panda (2008) 4.0
Coraline (2009) 4.0
Star Trek (2009) 4.0
I Can’t Think Straight (2007) 4.0
9 (2009) 4.0
Inception (2010) 4.0
I Killed My Mother (J’ai tué ma mère) (2009) 4.0
Megamind (2010) 4.0
Harry Potter and the Deathly Hallows: Part 1 (2010) 4.0
Captain America: The First Avenger (2011) 4.0
Brave (2012) 4.0
ParaNorman (2012) 4.0
Dredd (2012) 4.0
Perks of Being a Wallflower, The (2012) 4.0
Wreck-It Ralph (2012) 4.0
Rise of the Guardians (2012) 4.0
Iron Man 3 (2013) 4.0
Now You See Me (2013) 4.0
Edge of Tomorrow (2014) 4.0
White Frog (2012) 4.0
Pride (2014) 4.0
John Wick (2014) 4.0
Big Hero 6 (2014) 4.0
Deadpool (2016) 4.0
Avengers: Infinity War - Part I (2018) 4.0
Guardians of the Galaxy 2 (2017) 4.0
Untitled Spider-Man Reboot (2017) 4.0
Halloweentown High (2004) 4.0
Cloudburst (2011) 4.0
Carol (2015) 4.0
The Martian (2015) 4.0
Spotlight (2015) 4.0
Kung Fu Panda 3 (2016) 4.0
Zootopia (2016) 4.0
The Magnificent Seven (2016) 4.0
DC Super Hero Girls: Hero of the Year (2016) 4.0
Marvel One-Shot: Agent Carter (2013) 4.0
Jumanji: Welcome to the Jungle (2017) 4.0
Love, Simon (2018) 4.0
Ant-Man and the Wasp (2018) 4.0
Rear Window (1954) 4.5
Paris Is Burning (1990) 4.5
Star Trek: First Contact (1996) 4.5
Anastasia (1997) 4.5
Dark City (1998) 4.5
Memento (2000) 4.5
Big Eden (2000) 4.5
Others, The (2001) 4.5
Lilo & Stitch (2002) 4.5
Spirited Away (Sen to Chihiro no kamikakushi) (2001) 4.5
Laputa: Castle in the Sky (Tenkû no shiro Rapyuta) (1986) 4.5
Desert Hearts (1985) 4.5
Shaun of the Dead (2004) 4.5
Kiss Kiss Bang Bang (2005) 4.5
Hot Fuzz (2007) 4.5
WALL·E (2008) 4.5
District 9 (2009) 4.5
How to Train Your Dragon (2010) 4.5
Snowpiercer (2013) 4.5
Lilting (2014) 4.5
Star Wars: Episode VII - The Force Awakens (2015) 4.5
Inside Out (2015) 4.5
Star Trek Beyond (2016) 4.5
The Man from U.N.C.L.E. (2015) 4.5
Wonder Woman (2017) 4.5
Mystère à la Tour Eiffel (2015) 4.5
Thing, The (1982) 5.0
Princess Mononoke (Mononoke-hime) (1997) 5.0
Donnie Darko (2001) 5.0
My Neighbor Totoro (Tonari no Totoro) (1988) 5.0
Howl’s Moving Castle (Hauru no ugoku shiro) (2004) 5.0
Saving Face (2004) 5.0
In Bruges (2008) 5.0
Captain America: The Winter Soldier (2014) 5.0
Mad Max: Fury Road (2015) 5.0
Black Panther (2017) 5.0
Thor: Ragnarok (2017) 5.0
Rogue One: A Star Wars Story (2016) 5.0
The Lego Batman Movie (2017) 5.0
Logan (2017) 5.0
Movie
Shrek 2 (2004)
Superman II (1980)
Moulin Rouge (2001)
Memento (2000)
L.A. Confidential (1997)
My Big Fat Greek Wedding (2002)

Summary

By building the movie recommender system, we got a better understanding of how it works. The text book “Building Recommendation System with R” is not clear in some places. So, we had to google, to find out the implementation details.

The pros and cons of User based Collaborative Filtering (UBCF) and Single Valued Decomposition (SVD) approaches.

  • Recommendations of UBCF complements the item that the user was interactibg with.

  • We performed SVD, which decomposes a big matrix to lower order matrices, and oberved that the improvement in prediction.

  • UBCF relies on historial choices of user to make future recommendations. It assumes that users’ preference to be by and large constant.

Citation

  1. F. Maxwell Harper and Joseph A. Konstan. 2015. The MovieLens Datasets: History and Context. ACM Transactions on Interactive Intelligent Systems (TiiS) 5, 4: 19:1–19:19. https://doi.org/10.1145/2827872
  2. Linear Algebra and its Applications, 4th Edition, by David C. Lay

Forhad Akbar

6/21/2020