# How to deal with a sparse matrix when using a perceptron based recommender system?

I'm constrained to use a perceptron based method. I have a user-item matrix filled with rating data on scale of 1 to 5 like this, with around 50% of the matrix with no data:

r<- matrix(c(2,4, NA,5,NA,3, NA,5,NA,1,NA,3,NA,5,NA,4,4,NA,NA,NA,1,1,2,NA,1,1,1,1,NA,NA,NA,NA,2,3,4,2,NA,NA,NA,NA,3,4,5,1,NA,NA,2,3,NA), nrow=7).
#one row represents one user, hile one column represents one item
r
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,]    2    5   NA    1   NA    2    5
[2,]    4   NA    4    2   NA   NA    1
[3,]   NA    1    4   NA   NA   NA   NA
[4,]    5   NA   NA    1   NA   NA   NA
[5,]   NA    3   NA    1    2   NA    2
[6,]    3   NA   NA    1    3    3    3
[7,]   NA    5    1    1    4    4   NA


I'm recoding the NA's to 0's, which makes the perceptron give out only 2 classes (one containing all the 1's and 0's , and the other containing all the 2,3,4 and 5. Which is understandable I guess.) How do I deal with this? I tried mean imputation but the results are not good (20% accuracy)

(I can't give exact code due to this being a proprietary code of my company, but any perceptron based method should work for this example)

• Is 3 considered as neutral? if yes, it makes more sense to replace with 3 rather than 0. This might not be the perfect approach, but try checking it makes any difference. The reason is, if you replace with 0 then he disliked the movie which might mislead, instead you can try understanding what happens when you replace with 3. Commented Mar 22, 2018 at 1:28
• another procedure is to predict the missing values based on the available data, there is a paper published on that. Please go through the Link. Commented Mar 22, 2018 at 1:30