eval_model: Evaluate a model using k-fold cross-validation

Description Usage Arguments Details Value

View source: R/eval_model.R

Description

eval_model uses k-fold cross-validation to assess the performance of a type of model on a dataset.

Usage

1
2
3
4
5
6
7
8
9
eval_model(
  df,
  resp = NA,
  method,
  nfold = 10,
  simplify = T,
  ignore_col = NA,
  ...
)

Arguments

df

The data frame to train the model on

resp

The name of the column to be used as a response variable.

method

The method to be used in model-building. See the description for available methods.

nfold

The number of folds to use in k-fold cross-validation. The default is nfold = 10.

simplify

Whether to return the results from all folds or return a data frame summarizing the results (only reporting the average and standard deviation of all folds). The default is simplify = T.

ignore_col

Columns that will not be used in model-building, given as a character vector. This may be an identifying column. The default is ignore_col = NA.

...

Additional arguments to pass to the model method

Details

Currently, the function can evaluate the following model types, passed through the parameter method:

Value

A data frame of the results of k-fold cross-validation with the specified model parameters. Can be unsimplified (simplify = F), returning the result on each fold, or simplified, returning the average and standard deviation only. The function uses caret::defaultSummary and provides the summary statistics of R-squared, RMSE, and MAE.


awqx/qsarr documentation built on Oct. 2, 2021, 7:05 a.m.