evaluationScheme {recommenderlab} | R Documentation |
Creates from a data set an evaluation scheme. The scheme can be a simple split into training and test data, k-fold cross-evaluation or using k bootstrap samples.
evaluationScheme(data, ...) ## S4 method for signature 'ratingMatrix': evaluationScheme(data, method="split", train=0.9, k=10, given=3)
data |
data set. |
method |
a character string defining the recommender method to use (see details). |
train |
fraction of the data set used for training. |
k |
number of folds/times to run the evaluation. |
given |
single number of items given for evaluation or a vector of length of data giving the number of items given for each observation. |
... |
further arguments. |
evaluationScheme
creates an evaluation scheme with k
runs
following the given method:
"split"
randomly assigns
the proportion of objects given by train
to the training set and
the rest is used for the test set.
"cross-validation"
creates a k-fold cross-validation scheme. The data
is randomly split into k parts and in each run k-1 parts are used for
training and the remaining part is used for testing. After all runs each
part was used as test set once.
"bootstrap"
creates the training set by taking a bootstrap sample
(sampling with replacement) of size train
times size of the data set.
All objects not in the training set are used for testing.
Returns an object of class "evaluationScheme"
.
Kohavi, Ron (1995). "A study of cross-validation and bootstrap for accuracy estimation and model selection". Proceedings of the Fourteenth International Joint Conference on Artificial Intelligence, pp. 1137-1143.
evaluationScheme
,
ratingMatrix
.
data("MSWeb") MSWeb10 <- sample(MSWeb[rowCounts(MSWeb) >10,], 100) MSWeb10 esSplit <- evaluationScheme(MSWeb10, method="split", train = 0.9, k=4, given=3) esSplit esCross <- evaluationScheme(MSWeb10, method="cross-validation", k=4, given=3) esCross