Recommendations a Top-N list.
Objects can be created by
predict
with a recommender model and new data. Alternatively,
objects can be created from a realRatingMatrix using
getTopNLists
(see below).
ratings
:Object of class "list"
.
Each element in the list represents a top-N recommendation
(an integer vector) with item IDs (column numbers in the rating
matrix). The items are ordered in each vector.
items
:Object of class "list"
or NULL
.
If available, a list of the same structure as items
with the
ratings.
itemLabels
:Object of class "character"
n
:Object of class "integer"
specifying the
number of items in each recommendation.
Note that the actual number
on recommended items can be less depending on the data and the
used algorithm.
signature(from = "topNList", to = "dgTMatrix")
signature(from = "topNList", to = "dgCMatrix")
signature(from = "topNList", to = "ngCMatrix")
signature(from = "topNList", to = "matrix")
: returns
a matrix with the ratings for the top-N items. All other items have a rating of NA.
signature(from = "topNList", to = "list")
: returns a
list with the items in the topNList.
signature(x = "topNList")
: returns only the best
n recommendations (second argument is n
which defaults to 10).
The additional argument minRating
can be used to remove all
entries with a rating below this value.
signature(x = "realRatingMatrix")
: create
top-N lists from the ratings in x. Arguments are
n
(defaults to 10),
randomize
(default is NULL
) and
minRating
(default is NA
).
Items with a rating below minRating
will not be part of the
top-N list. randomize
can be used to get diversity in the
predictions by randomly selecting items with a bias to higher rated
items. The bias is introduced by choosing the items with a probability
proportional to the rating \((r-min(r)+1)^{randomize}\).
The larger the value
the more likely it is to get very highly rated items and a negative
value for randomize
will select low-rated items.
signature(x = "topNList")
: get the ratings
associated with the items recommended in the top-N list.
signature(x = "topNList")
: for how many users
does this object contain a top-N list?
signature(x = "topNList")
:
remove items from the top-N list which are known (have a rating)
for the user given as a ratingMatrix passed on as argument
known
.
signature(x = "topNList")
: in how many top-N
does each item occur?
signature(x = "topNList")
: number of recommendations per user.
signature(object = "topNList")