predict,regr.task-method(mlr)R Documentation

predict

Description

Predicts the target values of a new data set based on an already fitted wrapped.model of a regression task.

Usage

## S4 method for signature 'regr.task':
predict(object, model, newdata)

Arguments

object [learn.task]
Learning task
model [wrapped.model]
Wrapped model, trained from learn task
newdata [data.frame]
Contains new observations which should be predicted (by default the train data of the wrapped model).

Details

See documentation super method.

Value

A vector of numeric values.

See Also

predict

Examples

data(BostonHousing)
inds <- seq(1, nrow(BostonHousing), 2)
test <- BostonHousing[-inds,]

rt <- make.regr.task("stats.lm", data=BostonHousing, formula=medv~.)
model <- train(rt, subset=inds)
predict(rt, model, newdata = test)

[Package mlr version 0.3.180 Index]