Learn R Programming

RMCLab (version 0.1.0)

validation_control: Control objects for hyperparameter validation

Description

Construct control objects for repeated holdout validation or \(K\)-fold cross-validation.

Usage

holdout_control(pct = 0.1, R = 10L)

cv_folds_control(K = 5L)

Value

An object inheriting from class "split_control" containing the relevant information for splitting the the observed cells of a data matrix into training and validation sets for hyperparameter tuning.

The subclass "holdout_control" returned by holdout_control()

is a list with components pct and R containing the corresponding argument values after validity checks.

The subclass "cv_folds_control" returned by cv_folds_control()

is a list with a single component K containing the corresponding argument value after validity checks.

Arguments

pct

numeric in the interval (0, 1); the percentage of observed cells in the data matrix to be randomly selected into the validation set (defaults to 0.1).

R

an integer giving the number of random splits into training and validation sets (defaults to 10).

K

an integer giving the number of cross-validation folds (defaults to 5).

See Also

create_splits(),

rdmc_tune(), soft_impute_tune()

Examples

Run this code
# toy example derived from MovieLens 100K dataset
data("MovieLensToy")
# robust discrete matrix completion with hyperparameter tuning
set.seed(20250723)
fit <- rdmc_tune(MovieLensToy, 
                 lambda = fraction_grid(nb_lambda = 6),
                 splits = holdout_control(R = 5))
# extract optimal value of regularization parameter
get_lambda(fit)

Run the code above in your browser using DataLab