Description Usage Arguments Value See Also Examples
Evaluates a single or a list of recommender model given an evaluation scheme.
1 2 3 4 5 6 7 8 | evaluate(x, method, ...)
## S4 method for signature 'evaluationScheme,character'
evaluate(x, method, type="topNList",
n=1:10, parameter=NULL, progress = TRUE, keepModel=FALSE)
## S4 method for signature 'evaluationScheme,list'
evaluate(x, method, type="topNList",
n=1:10, parameter=NULL, progress = TRUE, keepModel=FALSE)
|
x |
an evaluation scheme (class |
method |
a character string or a list. If
a single character string is given it defines the recommender method
used for evaluation. If several recommender methods need to be compared,
|
type |
evaluate "topNList" or "ratings"? |
n |
N (number of recommendations) of the top-N lists generated (only if type="topNList"). |
parameter |
a list with parameters for the recommender algorithm (only
used when |
progress |
logical; report progress? |
keepModel |
logical; store used recommender models? |
... |
further arguments. |
Returns an object of class "evaluationResults"
or if method
is a list an object of class "evaluationResultList"
.
evaluationScheme
,
evaluationResults
.
evaluationResultList
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | ### evaluate top-N list recommendations on a 0-1 data set
## Note: we sample only 100 users to make the example run faster
data("MSWeb")
MSWeb10 <- sample(MSWeb[rowCounts(MSWeb) >10,], 100)
## create an evaluation scheme (10-fold cross validation, given-3 scheme)
es <- evaluationScheme(MSWeb10, method="cross-validation",
k=10, given=3)
## run evaluation
ev <- evaluate(es, "POPULAR", n=c(1,3,5,10))
ev
## look at the results (by the length of the topNList)
avg(ev)
plot(ev, annotate = TRUE)
## evaluate several algorithms with a list
algorithms <- list(
RANDOM = list(name = "RANDOM", param = NULL),
POPULAR = list(name = "POPULAR", param = NULL)
)
evlist <- evaluate(es, algorithms, n=c(1,3,5,10))
plot(evlist, legend="topright")
## select the first results
evlist[[1]]
### Evaluate using a data set with real-valued ratings
## Note: we sample only 100 users to make the example run faster
data("Jester5k")
es <- evaluationScheme(Jester5k[1:100], method="cross-validation",
k=10, given=10, goodRating=5)
## Note: goodRating is used to determine positive ratings
## predict top-N recommendation lists
## (results in TPR/FPR and precision/recall)
ev <- evaluate(es, "RANDOM", type="topNList", n=10)
avg(ev)
## predict missing ratings
## (results in RMSE, MSE and MAE)
ev <- evaluate(es, "RANDOM", type="ratings")
avg(ev)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.