Learn R Programming

RMCLab (version 0.1.0)

get_lambda: Extract the optimal value of the regularization parameter

Description

Extract the optimal value of the regularization parameter from an object returned by a matrix completion algorithm.

Usage

get_lambda(object, ...)

# S3 method for rdmc_tuned get_lambda(object, ...)

# S3 method for rdmc get_lambda(object, relative = TRUE, ...)

# S3 method for soft_impute_tuned get_lambda(object, ...)

# S3 method for soft_impute get_lambda(object, relative = TRUE, ...)

Value

The optimal value of the regularization parameter.

Arguments

object

an object returned by a matrix completion algorithm with a regularization parameter.

...

additional arguments to be passed down to methods.

relative

logical; in case the values of the regularization parameter were given relative to a certain reference value computed from the data at hand, this allows to return the optimal value before or after multiplication with that reference value.

Author

Andreas Alfons

See Also

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)

# for more examples, see the help files of other functions for 
# matrix completion and imputation methods

Run the code above in your browser using DataLab