topNList-class: Class "topNList": Top-N List

Description Objects from the Class Slots Methods See Also

Description

Recommendations a Top-N list.

Objects from the Class

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).

Slots

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.

Methods

coerce

signature(from = "topNList", to = "dgTMatrix")

coerce

signature(from = "topNList", to = "dgCMatrix")

coerce

signature(from = "topNList", to = "ngCMatrix")

coerce

signature(from = "topNList", to = "matrix")

coerce

signature(from = "topNList", to = "list")

bestN

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.

getTopNLists

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.

getRatings

signature(x = "topNList"): get the ratings associated with the items recommended in the top-N list.

length

signature(x = "topNList"): for how many users does this object contain a top-N list?

removeKnownItems

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.

colCounts

signature(x = "topNList"): in how many top-N does each item occur?

rowCounts

signature(x = "topNList"): number of recommendations per user.

show

signature(object = "topNList")

See Also

evaluate, getList, realRatingMatrix


audachang/recommenderlab.test documentation built on May 20, 2019, 1:27 p.m.