predict {recommenderlab} | R Documentation |
Predict Recommendations
Description
Creates recommendations using a recommender model and data about new users.
Usage
## S4 method for signature 'Recommender'
predict(object, newdata, n = 10, data=NULL,
type="topNList", ...)
Arguments
object |
a recommender model (class |
newdata |
data for active users (class |
n |
number of recommendations in the top-N list. |
data |
training data needed by some recommender algorithms if
|
type |
type of recommendation. The default type is
|
... |
further arguments. |
Value
Returns an object of class "topNList"
or of other appropriate
classes.
See Also
Examples
data("MovieLense")
MovieLense100 <- MovieLense[rowCounts(MovieLense) >100,]
train <- MovieLense100[1:50]
rec <- Recommender(train, method = "POPULAR")
rec
## create top-N recommendations for new users
pre <- predict(rec, MovieLense100[101:102], n = 10)
pre
as(pre, "list")
## predict ratings for new users
pre <- predict(rec, MovieLense100[101:102], type="ratings")
pre
as(pre, "matrix")[,1:10]
## create recommendations using user ids with ids 1..10 in the
## training data
pre <- predict(rec, 1:10 , data = train, n = 10)
pre
as(pre, "list")