Store predicted values generated in model functions
# S3 method for model.predict store(dataset, object, name = "prediction", ...)
dataset | Dataset to add predictions to |
---|---|
object | Return value from model function |
name | Variable name(s) assigned to predicted values |
... | Additional arguments |
See https://radiant-rstats.github.io/docs/model/regress.html for an example in Radiant
regress(diamonds, rvar = "price", evar = c("carat", "cut")) %>% predict(pred_data = diamonds) %>% store(diamonds, ., name = c("pred", "pred_low", "pred_high")) %>% head()#> # A tibble: 6 x 14 #> price carat clarity cut color depth table x y z date #> <int> <dbl> <fct> <fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <date> #> 1 580 0.32 VS1 Ideal H 61 56 4.43 4.45 2.71 2012-02-26 #> 2 650 0.34 SI1 Very… G 63.4 57 4.45 4.42 2.81 2012-02-26 #> 3 630 0.3 VS2 Very… G 63.1 58 4.27 4.23 2.68 2012-02-26 #> 4 706 0.35 VVS2 Ideal H 59.2 56 4.6 4.65 2.74 2012-02-26 #> 5 1080 0.4 VS2 Prem… F 62.6 58 4.72 4.68 2.94 2012-02-26 #> 6 3082 0.6 VVS1 Ideal E 62.5 53.7 5.35 5.43 3.38 2012-02-26 #> # … with 3 more variables: pred <dbl>, pred_low <dbl>, pred_high <dbl>