| resample.performance(mlr) | R Documentation |
Measures the quality of predictions w.r.t. some loss function for a resampled fit.
resample.performance(learn.task, resample.instance, resample.result, measure)
learn.task |
[learn.task] Specifies the learning task for the problem. |
resample.instance |
[resample.instance] Specifies the training and test indices of the resampled data. |
resample.result |
[resample.result] |
measure |
[character/list] Name of performance measure to optimize or a list describing your own performance measure. The default is mean misclassification error for classification or MSE for regression. |
A list with the following entries:
|
Numeric vector of estimated performances for the resampling iterations. |
|
Aggregated performance of above performance values. Aggregation is defined by the performance measure, e.g. mean or median. |
|
Spread of above performance values. Defined by the performance measure, e.g. standard deviation. |
library(mlbench)
data(BostonHousing)
# define a regression task for the Boston Housing problem with a simple linear modell
rt <- make.regr.task("lm", data=iris, formula=medv~.)
# do 3-fold crossvalidation
cv.i <- make.cv.instance(size=nrow(BostonHousing), iters=3)
rf <- resample.fit(rt, cv.i)
# mean squared error
resample.performance(rt, cv.i, rf)
# median of absolute errors
resample.performance(rt, cv.i, rf, measure="mae")