crossValidFunction: CROSS-VALIDATION FUNCTION

View source: R/crossValidation.R

crossValidFunctionR Documentation

CROSS-VALIDATION FUNCTION

Description

CROSS-VALIDATION FUNCTION

Usage

crossValidFunction(
  fullDT,
  statsModel,
  origData,
  k = 4,
  idCol,
  parallel = FALSE,
  cacheObj1 = NULL,
  cacheObj2 = NULL,
  cacheArgs = NULL,
  level = NULL,
  ...
)

Arguments

fullDT

data.table with full dataset

statsModel

the statistical model to validate. Only works with gamlss models

origData

the data used to fit the statsModule, needs to be passed to gamlss::predictAll() (it may not be able to access it) but also to make sure newdata in gamlss::predictAll() has the same variables (even if they're not used in the model)

k

integer with number of chunks that the data should be partitioned in

idCol

column with pixel/observation IDs (optional)

parallel

logical. Uses future.apply::future_lapply() to parallelise model fitting across the k-folds, using plan(multiprocess). Defaults to FALSE

cacheObj1

object used by reproducible::Cache() for digesting, to avoid digesting the (potentially) large data arguments

cacheObj2

object used by reproducible::Cache() for digesting, to avoid digesting the (potentially) large data arguments

cacheArgs

a named list of arguments passed to inner Cache calls

level

passed to gamlss:::predict

...

further arguments passed to future::plan()


CeresBarros/ToolsCB documentation built on Aug. 23, 2024, 4:22 p.m.