Description Usage Arguments Details Examples
View source: R/model_fitting.R
Perform k-fold cross-validation for a given host and kernel configuration choice
1 2 3 4 5 6 7 8 | perform_cv(
data,
host,
taxa_covariance,
sample_covariance,
tax_level = "ASV",
holdout_proportion = 0.2
)
|
data |
a phyloseq object |
host |
host short name (e.g. ACA) |
sample_covariance |
composite kernel function |
tax_level |
taxonomic level at which to agglomerate data |
holdout_proportion |
proportion of host's sample to use as a test set |
rho |
scalar bandwidth parameter |
iterations |
number of CV iterations to perform; this should be <= n_samples for this host |
average error (currently RMSE of log counts)
1 2 3 4 5 | tax_level <- "ASV"
data <- load_data(tax_level = tax_level)
sample_covariance <- get_Gamma(kernel_scale = 2, proportions = c(1, 0, 0), min_correlation = 0.1, days_to_baseline = 90)
taxa_covariance <- get_Xi(phyloseq::ntaxa(data), total_variance = 1)
perform_cv(data, host = "GAB", taxa_covariance = taxa_covariance, sample_covariance = sample_covariance, tax_level = tax_level)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.