Evaluate the performance of different regression models

evalreg(
  dataset,
  pred,
  rvar,
  train = "All",
  data_filter = "",
  envir = parent.frame()
)

Arguments

dataset

Dataset

pred

Predictions or predictors

rvar

Response variable

train

Use data from training ("Training"), test ("Test"), both ("Both"), or all data ("All") to evaluate model evalreg

data_filter

Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "training == 1")

envir

Environment to extract data from

Value

A list of results

Details

Evaluate different regression models based on predictions. See https://radiant-rstats.github.io/docs/model/evalreg.html for an example in Radiant

See also

summary.evalreg to summarize results

plot.evalreg to plot results

Examples

data.frame(price = diamonds$price, pred1 = rnorm(3000), pred2 = diamonds$price) %>% evalreg(pred = c("pred1", "pred2"), "price") %>% str()
#> List of 10 #> $ rv : int [1:3000] 580 650 630 706 1080 3082 3328 4229 1895 3546 ... #> $ dat :'data.frame': 2 obs. of 6 variables: #> ..$ Type : chr [1:2] "All" "All" #> ..$ Predictor: chr [1:2] "pred1" "pred2" #> ..$ n : int [1:2] 3000 3000 #> ..$ Rsq : num [1:2] 0.00000153 1 #> ..$ RMSE : num [1:2] 5560 0 #> ..$ MAE : num [1:2] 3907 0 #> $ vars : chr [1:3] "pred1" "pred2" "price" #> $ df_name : chr "." #> $ dataset :'data.frame': 3000 obs. of 3 variables: #> ..$ price: int [1:3000] 580 650 630 706 1080 3082 3328 4229 1895 3546 ... #> ..$ pred1: num [1:3000] 0.16 1.014 0.897 1.867 1.65 ... #> ..$ pred2: int [1:3000] 580 650 630 706 1080 3082 3328 4229 1895 3546 ... #> $ pred : chr [1:2] "pred1" "pred2" #> $ rvar : chr "price" #> $ train : chr "All" #> $ data_filter: chr "" #> $ envir :<environment: 0x11b2fc38> #> - attr(*, "class")= chr [1:2] "evalreg" "list"