I have a data set, Recoset, of ratings given by users for certain product categories. I am trying to learn use the ratings given by users to predict product categories that other users may like by putting the User Based Collaborative Filtering of recommenderLab package to use, in R.
Here is the code
m <- read.csv("recoset2.csv")
rrm <-as(m,"realRatingMatrix")
rrm2 <- rrm[rowCounts(rrm)>5] #only users who have bought from more than 5 verticals (any random 5)
learn <- Recommender(rrm2,method = "UBCF")
learned <- predict(learn,rrm[2001:2010,],n=3)
learned_list <- as(learned,"list")
Now the code works perfectly fine (sometimes) as long as I am predicting for 10 users or less. But the moment I increase the number of users to 11 or more in this manner
learned <- predict(learn,rrm[2001:2020],n=3)
I am greeted by this error
Error in neighbors[, x] : incorrect number of dimensions
This error at times also props up for as low as 2 users, but never have I received this error for 1 user.
I have spent days by myself, gone through the entire recommenderLab documentation, scoured numerous sources & tutorials but debug this error. Any help in resolving this would be immensely appreciated
> user item rating
> ORG1SNQ0TV16NQP6ZB5SD9XGX1FP7 MobileCable 2
> ORG441VE999BMCTYGZ0H7HDWHGX62 OTGPendrive 2
> ORG7L1NRFQZTPDJRFXC0CQ1LXLY6E MobileScreenGuard 3
> ORGBYFYMG92YFDC043NG7PZEHEPTS MobileScreenGuard 2
> ORGLZH07SFPSFQ3RZJMCV85XKKDKE Smartphone 5
> ORGMBN2841ZDJDZD4HHEN28HB5YYP Headphone 1
Here is the link to the dataset