Skip to contents

Loads a previously scaled design matrix and continues the stochastic gradient optimisation for a subset of variables.

Usage

partialbigSurvSGDv0(
  name.col,
  datapath,
  ncores = 1,
  resBigscale,
  bigmemory.flag = FALSE,
  parallel.flag = FALSE,
  inf.mth = "none"
)

Arguments

name.col

Character vector containing the column names that should be included in the partial fit.

datapath

File system path or connection where the big-memory backing file for the scaled design matrix is stored.

ncores

Number of processor cores allocated to the partial fitting procedure. Defaults to 1.

resBigscale

Result object returned by bigscale containing scaling statistics to be reused. By default the helper reuses the globally cached resultsBigscale object created by bigscale.

bigmemory.flag

Logical flag determining whether big-memory backed matrices are used when loading and updating the design matrix. Defaults to FALSE.

parallel.flag

Logical flag toggling the use of parallelised stochastic gradient updates. Defaults to FALSE.

inf.mth

Inference method requested for the partial fit, such as "none", "asymptotic", or bootstrap summaries. Defaults to "none".

Value

Either a numeric vector of log hazard-ratio coefficients or, when inference is requested, a matrix whose columns correspond to the inferred coefficient summaries for each penalisation setting.

Examples

# \donttest{
data(micro.censure, package = "bigPLScox")
surv_data <- stats::na.omit(
  micro.censure[, c("survyear", "DC", "sexe", "Agediag")]
)
scaled <- bigscale(
  survival::Surv(survyear, DC) ~ .,
  data = surv_data,
  norm.method = "standardize",
  batch.size = 16
)
#> Warning: Strata size times batch size is greater than number of observations.
#>  This package resizes them to strata size = 20 and batch size = 4
datapath <- tempfile(fileext = ".csv")
utils::write.csv(surv_data, datapath, row.names = FALSE)

continued <- partialbigSurvSGDv0(
  name.col = c("Agediag", "sexe"),
  datapath = datapath,
  ncores = 1,
  resBigscale = scaled,
  bigmemory.flag = FALSE,
  parallel.flag = FALSE,
  inf.mth = "none"
)
# unlink(datapath)
# }