Learn R Programming

rrecsys (version 0.9.5.4)

recommend: Generate recommendation.

Description

This method generates top-n recommendations based on a model that has been trained before.

Usage

recommend(model, topN = 3)

Arguments

model

the trained model of any algorithm.

topN

number of items to be recommended per user, class numeric.

Value

Returns a list with suggested items for each user.

See Also

rrecsys.

Examples

Run this code
# NOT RUN {
myratings <- matrix(sample(c(0:5), size = 200, replace = TRUE, 
        prob = c(.6,.08,.08,.08,.08,.08)), nrow = 20, byrow = TRUE)

myratings <- defineData(myratings)

r <- rrecsys(myratings, alg = "FunkSVD", k = 2)

rec <- recommend(r)

# }

Run the code above in your browser using DataLab