Learn R Programming

TPLSr (version 1.0.4)

evalTuningParam: Evaluating cross-validation performance of a TPLS_cv model at compvec and threshvec

Description

Evaluating cross-validation performance of a TPLS_cv model at compvec and threshvec

Usage

evalTuningParam(
  TPLScvmdl,
  type = c("Pearson", "negMSE", "ACC", "AUC", "LLbinary", "Spearman"),
  X,
  Y,
  compvec,
  threshvec,
  subfold = NULL
)

Arguments

TPLScvmdl

TPLS_cv model created from TPLS_cv

type

CV performance metric type. One of LLbinary, negMSE, Pearson, Spearman, AUC, ACC.

X

The same X as used in TPLScvmdl.

Y

The SAME Y as used in TPLScvmdl.

compvec

Vector of number of components to test in cross-validation.

threshvec

Vector of threshold level (0 ~ 1) to test in cross-validation.

subfold

(Optional) vector of subdivision within testing fold to calculate performance. For example scan run division within subject.

Value

A evalTuningParam object that contains the following attributes.

  • type: Cross validation performance measure type, as specified in the input

  • threshval: Same as the input threshvec

  • compval: Same as the input compvec

  • perfmat: Performance measure 3D matrix: length(compvec)-by-length(threshvec)-by-numfold

  • perf_best: Best CV performance out of all combinations of compvec and threshvec

  • compval_best: Number of components that gave the best performance (i.e., perf_best)

  • threshval_best: Threshold level that gave the best performance (i.e., perf_best)

  • perf_1se : Performance of the most parsimonious model (least number of coefficients) that is within 1 standard error of perf_best.

  • compval_1se : Number of components that gave perf_1se

  • threshval_1se : Threshold level that gave perf_1se

  • best_at_threshold : a 3-column matrix; first column is max performance at threshold, second column is threshold values, third column is number of components for the best model at threshold