eval_params | R Documentation |
eval_params
evaluates a given setting of lambda and mu on a given matrix with a given PCP function.
The given matrix has a given percentage of its entries randomly corrupted as missing NA
values before evaluation.
The parameter setting is scored by how well the given PCP function recovers those randomly corrupted values.
eval_params(seed, mat, pcp_func, perc_b, eval_params, ...)
seed |
The seed to use for the random corruption of the given matrix, |
mat |
The data matrix to run PCP on. |
pcp_func |
The PCP function to use. Note: the PCP function passed must be able to handle missing |
perc_b |
The percentage of |
eval_params |
A character vector containing the names of the parameters under evaluation. |
... |
The parameters to pass on to |
lambda |
The value of lambda to be passed to |
mu |
The value of mu to be passed to |
A vector of length containing the values of the parameters used, along with evaluation metrics.
corrupt_mat_randomly
, grid_search_cv
, random_search_cv
, bayes_search_cv
library(pcpr) # since we will be passing grid_search_cv a PCP function # simulate a data matrix: n <- 50 p <- 10 data <- sim_data(sim_seed = 1, nrow = n, ncol = p, rank = 3, sigma=0, add_sparse = FALSE) mat <- data$M # pick a parameter setting of lambda and mu to try: lambda <- 1/sqrt(n) mu <- sqrt(p/2) # evaluate that setting: score <- eval_params(lambda, mu, 1, mat, root_pcp_na, .2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.