Learn R Programming

RMCLab (version 0.1.0)

get_completed: Extract the completed (imputed) data matrix

Description

Extract the completed (i.e., imputed) data matrix from an object returned by a matrix completion algorithm.

Usage

get_completed(object, ...)

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

# S3 method for rdmc get_completed(object, which, ...)

# S3 method for soft_impute_tuned get_completed(object, discretized = NULL, ...)

# S3 method for soft_impute get_completed(object, which, discretized = NULL, ...)

# S3 method for median_impute get_completed(object, discretized = NULL, ...)

# S3 method for mode_impute get_completed(object, ...)

get_imputed(object, ...)

Value

The completed (i.e., imputed) data matrix.

Arguments

object

an object returned by a matrix completion algorithm.

...

additional arguments to be passed down to methods.

which

an integer specifying the index of the regularization parameter for which to extract the completed data matrix.

discretized

a logical indicating if the completed data matrix with or without the discretization step should be extracted. The default is TRUE if the discretization step was performed and FALSE otherwise.

Author

Andreas Alfons and Aurore Archimbaud

See Also

rdmc_tune(), soft_impute_tune(), median_impute(), mode_impute()

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 completed matrix with optimal regularization parameter
X_hat <- get_completed(fit)
head(X_hat)

# 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