cv.mb.coxmos: Multiblock COX Cross-Validation Function

View source: R/Coxmos_mb_coxmos.R

cv.mb.coxmosR Documentation

Multiblock COX Cross-Validation Function

Description

This function provides a unified interface for all multiblock HD-COX cross-validation methods in the package.

Usage

cv.mb.coxmos(
  method = c("sb.splsicox", "sb.splsdrcox", "sb.splsdrcox_penalty", "sb.splsdacox",
    "isb.splsicox", "isb.splsdrcox", "isb.splsdrcox_penalty", "isb.splsdacox",
    "mb.splsdrcox", "mb.splsdacox"),
  X,
  Y,
  max.ncomp = 8,
  penalty.list = seq(0.1, 0.9, 0.2),
  vector = NULL,
  MIN_NVAR = 1,
  MAX_NVAR = NULL,
  n.cut_points = 5,
  n_run = 3,
  k_folds = 10,
  x.center = TRUE,
  x.scale = FALSE,
  remove_near_zero_variance = TRUE,
  remove_zero_variance = TRUE,
  toKeep.zv = NULL,
  remove_variance_at_fold_level = FALSE,
  remove_non_significant_models = FALSE,
  remove_non_significant = FALSE,
  alpha = 0.05,
  w_AIC = 0,
  w_C.Index = 0,
  w_AUC = 1,
  w_I.BRIER = 0,
  MIN_AUC_INCREASE = 0.01,
  EVAL_METHOD = "AUC",
  pred.method = "cenROC",
  pred.attr = "mean",
  MIN_AUC = 0.8,
  MIN_COMP_TO_CHECK = 3,
  max.iter = 200,
  times = NULL,
  max_time_points = 15,
  design = NULL,
  fast_mode = FALSE,
  MIN_EPV = 5,
  return_models = FALSE,
  returnData = FALSE,
  PARALLEL = FALSE,
  verbose = FALSE,
  seed = 123
)

Arguments

method

Cross-validation method to use: "sb.splsicox", "sb.splsdrcox", "sb.splsdrcox_penalty", "sb.splsdacox", "isb.splsicox", "isb.splsdrcox", "isb.splsdrcox_penalty", "isb.splsdacox", "mb.splsdrcox", or "mb.splsdacox".

X

List of numeric matrices or data.frames. Explanatory variables. Qualitative variables must be transform into binary variables.

Y

Numeric matrix or data.frame. Response variables. Object must have two columns named as "time" and "event". For event column, accepted values are: 0/1 or FALSE/TRUE for censored and event observations.

max.ncomp

Numeric. Maximum number of PLS components to compute for the cross validation (default: 8).

penalty.list

Numeric vector. Penalty for variable selection for the individual cox models. Variables with a lower P-Value than 1 - "penalty" in the individual cox analysis will be keep for the sPLS-ICOX approach (default: seq(0.1,0.9,0.2)) (sb.splsicox, sb.splsdrcox_penalty, isb.splsicox, isb.splsdrcox_penalty).

vector

Numeric vector. Used for computing best number of variables. As many values as components have to be provided. If vector = NULL, an automatic detection is perform (default: NULL) (sb.splsdrcox, sb.splsdacox, isb.splsdrcox, isb.splsdacox, mb.splsdrcox, mb.splsdacox).

MIN_NVAR

Numeric. Minimum range size for computing cut points to select the best number of variables to use (default: 1) (sb.splsdrcox, sb.splsdacox, isb.splsdrcox, isb.splsdacox, mb.splsdrcox, mb.splsdacox).

MAX_NVAR

Numeric. Maximum range size for computing cut points to select the best number of variables to use (default: NULL) (sb.splsdrcox, sb.splsdacox, isb.splsdrcox, isb.splsdacox, mb.splsdrcox, mb.splsdacox).

n.cut_points

Numeric. Number of cut points for searching the optimal number of variables. If only two cut points are selected, minimum and maximum size are used (default: 5) (sb.splsdrcox, sb.splsdacox, isb.splsdrcox, isb.splsdacox, mb.splsdrcox, mb.splsdacox).

n_run

Numeric. Number of runs for cross validation (default: 3).

k_folds

Numeric. Number of folds for cross validation (default: 10).

x.center

Logical. If x.center = TRUE, X matrix is centered to zero means (default: TRUE).

x.scale

Logical. If x.scale = TRUE, X matrix is scaled to unit variances (default: FALSE).

remove_near_zero_variance

Logical. If remove_near_zero_variance = TRUE, near zero variance variables will be removed (default: TRUE).

remove_zero_variance

Logical. If remove_zero_variance = TRUE, zero variance variables will be removed (default: TRUE).

toKeep.zv

Character vector. Name of variables in X to not be deleted by (near) zero variance filtering (default: NULL).

remove_variance_at_fold_level

Logical. If remove_variance_at_fold_level = TRUE, (near) zero variance will be removed at fold level (default: FALSE).

remove_non_significant_models

Logical. If remove_non_significant_models = TRUE, non-significant models are removed before computing the evaluation (default: FALSE).

remove_non_significant

Logical. If remove_non_significant = TRUE, non-significant variables/components in final cox model will be removed (default: FALSE).

alpha

Numeric. Numerical values are regarded as significant if they fall below the threshold (default: 0.05).

w_AIC

Numeric. Weight for AIC evaluator (default: 0).

w_C.Index

Numeric. Weight for C-Index evaluator (default: 0).

w_AUC

Numeric. Weight for AUC evaluator (default: 1).

w_I.BRIER

Numeric. Weight for BRIER SCORE evaluator (default: 0).

MIN_AUC_INCREASE

Numeric. Minimum improvement between different cross validation models to continue evaluating higher values (default: 0.01).

EVAL_METHOD

Character. The selected metric will be use to compute the best number of variables (default: "AUC") (sb.splsdrcox, sb.splsdacox, isb.splsdrcox, isb.splsdacox, mb.splsdrcox, mb.splsdacox).

pred.method

Character. AUC evaluation algorithm method (default: "cenROC") (sb.splsdrcox, sb.splsdacox, isb.splsdrcox, isb.splsdacox, mb.splsdrcox, mb.splsdacox).

pred.attr

Character. Way to evaluate the metric selected (default: "mean").

MIN_AUC

Numeric. Minimum AUC desire to reach cross-validation models (default: 0.8).

MIN_COMP_TO_CHECK

Numeric. Number of penalties/components to evaluate to check if the AUC improves (default: 3).

max.iter

Numeric. Maximum number of iterations for PLS convergence (default: 200) (sb.splsdrcox, sb.splsdacox, isb.splsdrcox, isb.splsdacox, mb.splsdrcox, mb.splsdacox).

times

Numeric vector. Time points where the AUC will be evaluated (default: NULL) (sb.splsdrcox, sb.splsdacox, isb.splsdrcox, isb.splsdacox, mb.splsdrcox, mb.splsdacox).

max_time_points

Numeric. Maximum number of time points to use for evaluating the model (default: 15) (sb.splsdrcox, sb.splsdacox, isb.splsdrcox, isb.splsdacox, mb.splsdrcox, mb.splsdacox).

design

Numeric matrix. Matrix of size (number of blocks in X) x (number of blocks in X) with values between 0 and 1 (default: NULL) (mb.splsdrcox and mb.splsdacox).

fast_mode

Logical. If fast_mode = TRUE, for each run, only one fold is evaluated simultaneously (default: FALSE).

MIN_EPV

Numeric. Minimum number of Events Per Variable (EPV) you want reach for the final cox model (default: 5).

return_models

Logical. Return all models computed in cross validation (default: FALSE).

returnData

Logical. Return original and normalized X and Y matrices (default: TRUE).

PARALLEL

Logical. Run the cross validation with multicore option (default: FALSE).

verbose

Logical. If verbose = TRUE, extra messages could be displayed (default: FALSE).

seed

Number. Seed value for performing runs/folds divisions (default: 123).

Value

A cross-validation object of the specified multiblock type.

See Also

cv.sb.splsicox for Single-Block SPLS-ICOX cross-validation, cv.sb.splsdrcox_penalty for Single-Block SPLS-DRCOX with penalty cross-validation, cv.sb.splsdrcox for Single-Block SPLS-DRCOX cross-validation, cv.sb.splsdacox for Single-Block SPLS-DACOX cross-validation, cv.isb.splsicox for Integrated Single-Block SPLS-ICOX cross-validation, cv.isb.splsdrcox_penalty for Integrated Single-Block SPLS-DRCOX with penalty cross-validation, cv.isb.splsdrcox for Integrated Single-Block SPLS-DRCOX cross-validation, cv.isb.splsdacox for Integrated Single-Block SPLS-DACOX cross-validation, cv.mb.splsdrcox for Multi-Block SPLS-DRCOX cross-validation, cv.mb.splsdacox for Multi-Block SPLS-DACOX cross-validation

Examples

data("X_multiomic")
data("Y_multiomic")
set.seed(123)
X_train <- X_multiomic
X_train$mirna <- X_train$mirna[1:30,1:30]
X_train$proteomic <- X_train$proteomic[1:30,1:30]
Y_train <- Y_multiomic[1:30,]
cv_mb <- cv.mb.coxmos(method = "sb.splsicox", X = X_train, Y = Y_train,
                     max.ncomp = 1, n_run = 1, k_folds = 3)

Coxmos documentation built on June 8, 2025, 10:30 a.m.