crv_pred: Perform cross validation for the snowload functions

Description Usage Arguments Value

View source: R/cross_val.R

Description

This function is a wrapper function to perform k-fold cross validation on the various functions in the snowload package.

Usage

1
2
crv_pred(tdata, formula, fun, folds = 10, score = "None",
  message = FALSE, ...)

Arguments

tdata

The dataset on which cross validation will be performed.

fun

The name of the function on which to perform cross validation this must be a function from the snowload package.

folds

The number of groups to separate the data when performing cross validation. The default is 10, the minimum is 2 and the maximum is the number of observations.

score

A character string of "MAE" for mean absolute error, "RMSE" for root mean square error, "ME" for mean error, and "none" when you would like the function to simply return the cross validation predictions.

...

Additional arguments to the function specified in the fun argument.

Value

A list of two, with the first item being a single numeric value specifying the MAE or RMSE. The second is a vector with the full set of errors resulting from the cross validation.


beanb2/snowload documentation built on Jan. 7, 2020, 9:48 p.m.