print_gs | R Documentation |
formatted
output from bayes_search_cv
, grid_search_cv
, or random_search_cv
.print_gs
visualizes the formatted
output grid searches in the form of heatmaps.
print_gs(df, dlambda = -1, dmu = -1, title = "Lambda and Mu Grid Search")
df |
The |
dlambda |
A numeric providing the default value of lambda used in the grid search. |
dmu |
A numeric providing the default value of mu used in the grid search. |
title |
A character providing the title for the plot. By default, |
A heatmaply
plot.
bayes_search_cv
, grid_search_cv
, random_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 parameter settings of lambda and mu to try: lambdas <- c(1/sqrt(n), 1.25/sqrt(n), 1.5/sqrt(n)) mus <- c(sqrt(p/2), sqrt(p/1.5), sqrt(p/1.25)) param_grid <- expand.grid(lambda = lambdas, mu = mus) # run the grid search: param_grid.out <- bayes_search_cv(mat, pcp_func = root_pcp_na, grid_df = param_grid, init_evals = 3, bayes_evals = 3, cores = 4, acquisition_function = "ei", perc_b = 0.2, runs = 20, seed = 1, verbose = TRUE, file = NULL) # visualize the output: print_gs(param_grid.out$formatted)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.