print_gs: Visualizes the 'formatted' output from 'bayes_search_cv',...

View source: R/print_gs.R

print_gsR Documentation

Visualizes the formatted output from bayes_search_cv, grid_search_cv, or random_search_cv.

Description

print_gs visualizes the formatted output grid searches in the form of heatmaps.

Usage

print_gs(df, dlambda = -1, dmu = -1, title = "Lambda and Mu Grid Search")

Arguments

df

The formatted output from bayes_search_cv, grid_search_cv, or random_search_cv.

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, title = "Lambda and Mu Grid Search"

Value

A heatmaply plot.

See Also

bayes_search_cv, grid_search_cv, random_search_cv

Examples


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)

Columbia-PRIME/PCPhelpers documentation built on April 24, 2022, 7:57 p.m.