predict_new: Perform predictions on new data

View source: R/predict_new.R

predict_newR Documentation

Perform predictions on new data

Description

This function is used when the user created the models and evaluated them on a dataset x and later on, he got new observations and wants to predict the target value for them. The 'predict_new()' function quickly normalizes their format, like a subset of columns that were deleted for the models and makes predictions. It is strongly advised that the new dataset shouldn't have any missing values.

Usage

predict_new(train_out, data, verbose = TRUE)

Arguments

train_out

The output of the 'train()' function.

data

A dataset with the same format as the one used in 'train()' function, but with new observations.

verbose

A logical value, if set to TRUE, provides all information about the process, if FALSE gives none.

Value

A list of predictions.

Examples

## Not run: 
data(lisbon)
lisbon_train <- lisbon[1:200, ]
lisbon_new   <- lisbon[201:246, ]
out          <- train(lisbon_train, 'Price', verbose = FALSE, bayes_iter = 0, random_evals = 1)
preds        <- predict_new(out, lisbon_new)

## End(Not run)

ModelOriented/forester documentation built on June 6, 2024, 7:29 a.m.