Skip to contents

Model selection for ACMTF

Usage

ACMTF_modelSelection(
  datasets,
  modes,
  maxNumComponents = 3,
  sharedMode = 1,
  alpha = 1,
  beta = rep(0.001, length(datasets)),
  epsilon = 1e-08,
  nstart = 10,
  cvFolds = 10,
  numCores = 1,
  method = "CG",
  cg_update = "HS",
  line_search = "MT",
  max_iter = 10000,
  max_fn = 1e+05,
  rel_tol = 1e-08,
  abs_tol = 1e-08,
  grad_tol = 1e-08
)

Arguments

datasets

List of arrays of datasets. Multi-way and two-way may be combined.

modes

Numbered modes per dataset in a list. Example element 1: 1 2 3 and element 2: 1 4 for the X tensor and Y matrix case with a shared subject mode.

maxNumComponents

Maximum number of components to check (default 3).

sharedMode

Mode that is shared between all blocks, used to remove fibers for numFolds randomly initialized models.

alpha

Scalar penalizing the components to be norm 1 (default 1).

beta

Vector of penalty values for each dataset, penalizing the lambda terms (default 1e-3).

epsilon

Scalar value to make it possible to compute the partial derivatives of lambda (default 1e-8).

nstart

Number of randomly initialized models to create (default 10).

cvFolds

Number of CV folds to create (default 10).

numCores

Number of cores to use (default 1). A number higher than 1 will run the process in parallel.

method

Optimization method to use (default = "CG", the conjugate gradient). See mize::mize() for other options.

cg_update

Update method for the conjugate gradient algorithm, see mize::mize() for the options (default="HS", Hestenes-Steifel).

Line search algorithm to use, see mize::mize() for the options (default="MT", More-Thuente).

max_iter

Maximum number of iterations.

max_fn

Maximum number of function evaluations.

rel_tol

Relative function tolerance criterion for convergence.

abs_tol

Function tolerance criterion for convergence.

grad_tol

Absolute tolerence for the l2-norm of the gradient vector.

Value

List object containing plots of all metrics and dataframes containing the data used to create them.

Examples

set.seed(123)

I = 10
J = 5
K = 3
df = array(rnorm(I*J*K), c(I,J,K))
df2 = array(rnorm(I*J*K), c(I,J,K))
datasets = list(df, df2)
modes = list(c(1,2,3), c(1,4,5))

# A very small procedure is run to limit computational requirements
result = ACMTF_modelSelection(datasets,
                              modes,
                              maxNumComponents=2,
                              nstart=2,
                              cvFolds=2,
                              rel_tol=1e-2,
                              abs_tol=1e-2)

result$plots$overview