perform_cv: Perform k-fold cross-validation for a given host and kernel...

Description Usage Arguments Details Examples

View source: R/model_fitting.R

Description

Perform k-fold cross-validation for a given host and kernel configuration choice

Usage

1
2
3
4
5
6
7
8
perform_cv(
  data,
  host,
  taxa_covariance,
  sample_covariance,
  tax_level = "ASV",
  holdout_proportion = 0.2
)

Arguments

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

Details

average error (currently RMSE of log counts)

Examples

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)

kimberlyroche/ROL documentation built on Dec. 10, 2020, 2:18 a.m.