Learn R Programming

rrecsys (version 0.9.5.4)

evalRec: Evaluates the requested recommendation algorithm.

Description

Evaluates the recommendation task of an algorithm with a given configuration and based on the given evaluation model.

Usage

evalRec(model, ...)
# S4 method for evalModel
evalRec(model, alg, topN, goodRating, alpha, ... )

Arguments

model

Object of type evalModel. See evalModel-class.

alg

The algorithm to be used in the evaluation. Of class character.

topN

Object of class numeric, specifying the number of items to be recommended per user.

goodRating

Object of class numeric, indicating the threshold of the ratings to be considered a good. This attribute is not used when evaluating implicit feedback.

alpha

Object of class numeric, is the half-life parameter for the rankscore metric.

other attributes specific to the algorithm to be deployed. Refer to rrecsys.

Value

Returns a data frame with the precision, recall, F1, nDCG, RankScore, true positives(TP), false positives(FP), true negatives(TN), false negatives(FN) for each of the k-folds definded in the evaluation model and the overall average.

References

F. Ricci, L. Rokach, B. Shapira, and P. B. Kantor, editors. Recommender Systems Handbook. Springer, 2011. ISBN 978-0-387-85819-7. URL http://www.springerlink.com/content/978-0-387-85819-7.

See Also

evalModel-class, rrecsys.

Examples

Run this code
# NOT RUN {
  x <- matrix(sample(c(0:5), size = 200, replace = TRUE, 
        prob = c(.6,.8,.8,.8,.8,.8)), nrow = 20, byrow = TRUE)
  
  x <- defineData(x)
        
  e <- evalModel(x, 5)
  
  SVDEvaluation <- evalRec(e, "FunkSVD", goodRating = 4, k = 4) 
  
  SVDEvaluation         
  
  
  IBEvaluation <- evalRec(e, "IBKNN", goodRating = 4, neigh = 5)
  
  IBEvaluation
  
# }

Run the code above in your browser using DataLab