predict

0th

Percentile

Predict Recommendations

Creates recommendations using a recommender model and data about new users.

Usage
"predict"(object, newdata, n = 10, data=NULL, type="topNList", ...)
Arguments
object
a recommender model (class "Recommender").
newdata
data for active users (class "ratingMatrix") or the index of users in the training data to create recommendations for. If an index is used then some recommender algorithms need to be passed the training data as argument data. Some algorithms may only support user indices.
n
number of recommendations in the top-N list.
data
training data needed by some recommender algorithms if newdata is a user index and not user data.
type
type of recommendation. The default type is "topNList" which creates a top-N recommendation list with recommendations. Some recommenders can also create other results (e.g., type "ratings" returns only predicted ratings with known ratings represented by NA, or type "ratingMatrix" which returns a completed rating matrix).
...
further arguments.
Value

Returns an object of class "topNList" or of other appropriate classes.

See Also

Recommender, ratingMatrix.

Aliases
  • predict
  • predict,Recommender-method
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")
Documentation reproduced from package recommenderlab, version 0.2-1, License: GPL-2

Community examples

Looks like there are no examples yet.