CheckPredictionVariables: 'CheckPredictionVariables'

View source: R/checks.R

CheckPredictionVariablesR Documentation

CheckPredictionVariables

Description

Verifies that newdata is consistent with data used to used to fit a model. The newdata must contain a superset of the variables used to fit the model or an error results. Variables that are factors in the training data are coerced to factors in newdata. If a factor variable in newdata contains additional levels than the factor used for fitting, a warning is given and instances with such additional levels are set to NA in the returned data. The levels of the returned data frame are set to those of the fitted model.

Usage

CheckPredictionVariables(object, newdata)

Arguments

object

A model object for which prediction is desired.

newdata

A data.frame including the variables used to fit the model.


NumbersInternational/flipData documentation built on March 2, 2024, 10:52 a.m.