Hello -

I'm working on the below code and I thought it would work, but it doesn't. I keep getting an error on the Predict function

# simulate matrix with 1000 users and 100 movies
m <- matrix(nrow = 1000, ncol = 100)

# simulated ratings (1% of the data)
m[sample.int(100*1000, 1000)] <- ceiling(runif(1000, 0, 5))

## convert into a realRatingMatrix
r <- as(m, "realRatingMatrix")

library(recommenderlab)
UB.Rec <- Recommender(r, method = "UBCF")

pred <- predict(UB.Rec, r, type="ratings")

as(pred, "matrix")

This is the error

Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 't': not-yet-implemented method for <dgCMatrix> %*% <list>

I would be most appreciative if someone could help me figure out what is wrong with the code.

Thank you!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.