k_fold_cross: k_fold_cross

View source: R/models.R

k_fold_crossR Documentation

k_fold_cross

Description

k_fold_cross splits the dataset into k parts, and uses k-1 parts to train the model and the remaining part to test the model.

Usage

k_fold_cross(data,k)

Arguments

data

dataset which will be used for K-Fols Cross Validation

k

integer

Value

a list with two sublists: training set and test set

Examples

df = data.frame("hours"=c(1, 2, 4, 5, 5, 6, 6, 7, 8, 10, 11, 11, 12, 12, 14),
"score"=c(64, 66, 76, 73, 74, 81, 83, 82, 80, 88, 84, 82, 91, 93, 89))
k_fold_cross(df,k=2)

ProxReg documentation built on April 3, 2025, 9:21 p.m.