resample.performance(mlr)R Documentation

performance

Description

Measures the quality of predictions w.r.t. some loss function for a resampled fit.

Usage

resample.performance(learn.task, resample.instance, resample.result, measure)

Arguments

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.

Value

A list with the following entries:

values Numeric vector of estimated performances for the resampling iterations.
aggr Aggregated performance of above performance values. Aggregation is defined by the performance measure, e.g. mean or median.
spread Spread of above performance values. Defined by the performance measure, e.g. standard deviation.

Examples

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")

[Package mlr version 0.3.180 Index]