predict.validatr: Predict on validation set

Description Usage Arguments Value Examples

Description

Carries out prediction on validation set for each model.

Usage

1
2
## S3 method for class 'validatr'
predict(object, ...)

Arguments

object

a validatr object produced by model().

...

Name-value pairs of expressions. Each value should return a vector of predictions when evaluated. Arguments are automatically quoted and evaluated.

Value

A validatr object with predictions element.

Examples

1
2
3
4
5
6
iris %>%
  validatr(Sepal.Length, k = 3) %>%
  model(Model1 = lm(Sepal.Length ~ ., data = train),
        Model2 = lm(Sepal.Length ~ Sepal.Width + Petal.Width, data = train)) %>%
  predict(Model1 = predict(Model1, newdata = validation),
          Model2 = predict(Model2, newdata = validation))

camroach87/validatr documentation built on May 14, 2019, 2:41 p.m.