Learn R Programming

rrecsys (version 0.9.5.4)

recResultsClass: Results of a recommendation.

Description

Defines a structure for the results of a recommendation algorithm.

Arguments

Slots

indices:

indices of the recommended items for each user, class "list".

recommended:

names, if aviable, of the recommended items for each user, class "list".

Methods

show

signature(object = "recResultsClass")

[

signature(object = "dataSet", i = "ANY""): returns a subset of the recommended items.

Examples

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

colnames(x) <- paste0(rep("item-", 5), 1:5)
rownames(x) <- paste0(rep("user-", 20), 1:20)

x <- defineData(x)

model <- rrecsys(x, alg = "funk", k = 2, gamma = 0.1, lambda = 0.001)

rec <- recommend(model, topN = 1)

rec

rec[c(1,4,6)]

# }

Run the code above in your browser using DataLab