k_fold_cv {less}R Documentation

k-Fold Cross Validation

Description

Applies k-Fold cross validation to the given model on the given data

Usage

k_fold_cv(
  data = NULL,
  model = NULL,
  random_state = NULL,
  k = 5,
  y_index = ncol(data)
)

Arguments

data

The dataset to be used

model

A classification or a regression model (from LESS package)

random_state

A seed number to get reproducable result

k

Number of splits on the training set (defaults to 5)

y_index

Column index of the response variable on the given data. Default is the last column.

Value

A vector consists of metric of the individual folds and the average metric over the folds

Examples

k_fold_cv(data = iris, model = KNeighborsClassifier$new(), k = 3)

[Package less version 0.1.0 Index]