cv_na: NA cross validation folds generation

View source: R/utils.R

cv_naR Documentation

NA cross validation folds generation

Description

This type of cross validation consists of a single fold where all the NA values are taken to be the testing set and the remaining ones to be the training set. Useful in genomic selection when we want to predict the phenotypes of the individuals with missing phenotypes.

Usage

cv_na(x)

Arguments

x

(vector) The vector of values.

Value

A list with a single element which is a named list with the elements training wich includes the indices of those records to be part of the training set and testing wich includes the indices of those records to be part of the testing set.

Examples

## Not run: 
# Generates random data with NAs
x <- c(1, 2, 3, NA, 5, 6, 7, NA, 9, 10)
folds <- cv_na(x)
# Indices of training set in fold 1
folds[[1]]$training
# Indices of testing set in fold 1
folds[[1]]$testing

## End(Not run)


brandon-mosqueda/SKM documentation built on Feb. 8, 2025, 5:24 p.m.