# NOT RUN {
x <- matrix(sample(c(0:5), size = 100, replace = TRUE,
prob = c(.6,.08,.08,.08,.08,.08)), nrow = 20, byrow = TRUE)
colnames(x) <- paste0(rep("item-", 5), 1:5)
rownames(x) <- paste0(rep("user-", 20), 1:20)
x <- defineData(x)
model <- rrecsys(x, alg = "funk", k = 2, gamma = 0.1, lambda = 0.001)
rec <- recommend(model, topN = 1)
rec
rec[c(1,4,6)]
# }
Run the code above in your browser using DataLab