Prediction using SVD matrices

I am participating in a programming contest where I have data, where the first column is the user, the second column is a movie, and the third is a number in a ten-digit rating system.

0 0 9
0 1 8
1 1 4
1 2 6
2 2 7

And I have to predict the third column (user, movie ,?):

0 2
1 0
2 0
2 1

I also know the answers:

0 2 7.052009
1 0 6.687943
2 0 6.995272
2 1 6.687943

This data is in the table: Rows are users 0, 1, and 2; columns are movies 0, 1, and 2; cells are grades, 0did not vote:

     [,1] [,2] [,3]
[1,]    9    8    0
[2,]    0    4    6
[3,]    0    0    7

I use R lang to get SVD:

$d
[1] 12.514311  9.197763  2.189331

$u
          [,1]       [,2]       [,3]
[1,] 0.9318434 -0.3240669  0.1632436
[2,] 0.3380257  0.6116879 -0.7152458
[3,] 0.1319333  0.7216776  0.6795403

$v
          [,1]        [,2]       [,3]
[1,] 0.6701600 -0.31709904  0.6710691
[2,] 0.7037423 -0.01584988 -0.7102785
[3,] 0.2358650  0.94825998  0.2125341

Moved v:

          [,1]        [,2]       [,3]
[1,]  0.6701600   0.7037423   0.2358650
[2,] -0.31709904 -0.01584988  0.94825998
[3,]  0.6710691  -0.7102785   0.2125341

And I read about predicting movie ratings using this formula: enter image description here

But I do not understand how to predict such estimates:

0 2 7.052009
1 0 6.687943
2 0 6.995272
2 1 6.687943

For this data:

0 2
1 0
2 0
2 1
+4
source share
2

, . -, , , . SVD (PCA), ( ). , , , .

Netflix ( ), SVD, - PCA. , NaN, , .

, , , "", , , . 3 3 , , . , , .

"- " (RSEOF), PCA . , .

, acast reshape2:

library(reshape2)
library(sinkr) (download from GitHub: https://github.com/menugget/sinkr)

# Original data
df1 <- data.frame(user=factor(c(0,0,1,1,2)), movie=factor(c(0,1,1,2,2)), rank=c(9,8,4,6,7))
df1

# Data to predict
df2 <-data.frame(user=factor(c(0,1,2,2)), movie=factor(c(2,0,0,1)))
df2

# Re-organize data into matrix(movies=rows, users=columns)
m1 <- acast(df1, movie ~ user, fill=NaN)
m1

, eof sinkr (), RSEOF:

# PCA of m1 (using recursive SVD)
E <- eof(m1, method="svd", recursive=TRUE, center=FALSE, scale=FALSE)
E$u
E$A #(like "v" but with Lambda units added)
E$Lambda

NaN PCA ( E$A %*% t(E$u)):

# Reconstruct full m1 matrix using PCs
R <- eofRecon(E)
R

# Add predicted ranks to df2
pos <- (as.numeric(df2$user)-1)*length(levels(df1$movie)) + as.numeric(df2$movie)
pos
df2$rank <- R[pos]
df2

df2 /, :

  user movie     rank
1    0     2 9.246148
2    1     0 7.535567
3    2     0 6.292984
4    2     1 5.661985

, , ( 7). , () (), m1,

    0   1   2
0   9 NaN NaN
1   8   4 NaN
2 NaN   6   7

, "0" "2" , "1", , "1". "1", , . 7.05, , "1" (.. 8), RSEOF 9.2.

, , - , , , " ". , , , .

+5

, . eigendecomposition ( , SVD , U == V). A_pred = UEU ^ T, A_pred - A ( ). , A [i] [j] A_pred [i] [j].

+3

All Articles