tsolver_options: T-Solver Options

View source: R/tsolvers.R

tsolver_optionsR Documentation

T-Solver Options

Description

Every T-solver input except the data X, D and y, as one list (the C++ SolverOptions). Pass it to a solver's $new(X, D, y, options = ...). Each solver reads the fields it needs and ignores the rest; the defaults are the solver-level defaults.

Usage

tsolver_options(
  normalize = TRUE,
  intercept = TRUE,
  precentered = FALSE,
  scaling_mode = c("L2", "ZSCORE"),
  verbose = FALSE,
  tol = .Machine$double.eps,
  tie_seed = 0,
  n_threads = 1,
  exch_tie_alpha = 0,
  exch_tie_floor = 0.5,
  lambda2 = 0.1,
  rho_afs = 0.3,
  ncgmp_variant = c("line_search", "fully_corrective"),
  tenet_aug_use_lars = FALSE,
  tikhonov_validated = FALSE,
  kappa_dummy = 1,
  fold_dummies = FALSE,
  group_penalty = c("MEAN", "CENTERING"),
  cd_lambda_rel_tol = 0.001,
  cd_tol_certify = 1e-10,
  cd_tol_probe = 1e-08,
  cd_gram_cap = 400,
  cd_max_sweeps = 2000,
  cd_certified_localization = TRUE
)

Arguments

normalize

Logical; scale each column of X and D to unit L2 norm (or unit SD, see scaling_mode). FALSE when the caller pre-scaled (see the in-place note below). Default TRUE.

intercept

Logical; center X, D and y (an intercept is fitted). FALSE when the caller pre-centered. Default TRUE.

precentered

Logical; the caller centered X, D and y (intercept = FALSE on centered data, as in the T-Rex selectors). The centered columns span at most n - 1 dimensions, so the solver counts the intercept as with intercept = TRUE: the active set is capped at n - 1 and the degrees of freedom and Cp include the intercept. The data are not touched. Redundant when intercept is TRUE. Default FALSE.

scaling_mode

"L2" (default) or "ZSCORE": the column scaling applied when normalize is TRUE.

verbose

Logical; print status and diagnostics. Default FALSE.

tol

Numerical tolerance of the solver's internal comparisons. Default: machine epsilon. A selector sets its own tolerance on the solvers it runs, tol of trex_control (1e-6 by default).

tie_seed

Seed of the solver's tie-break engine. Default 0: a fixed seed, so a solver run is reproducible also where exact ties occur; a negative value seeds from the system entropy source (nondeterministic).

n_threads

Thread budget of the solver's own passes over the design (the correlation refreshes, the step-length search, the standardization). Default 1 (serial); a whole number of at least 1. A pass splits only above about a million entries of the design, and never inside a parallel region of the caller. The T-Rex selectors set it from trex_control(max_inner_threads = ).

exch_tie_alpha

Exchangeable-tie band width of the greedy solvers (TOMP, TOOLS, TGP, TACGP, TMP, TNCGMP and TAFS), in units of the pairwise ranking-noise sd; 0 (default) turns it off. The path solvers ignore it.

exch_tie_floor

Minimum absolute correlation for exchangeable-tie candidates, in [0, 1). Default 0.5.

lambda2

L2 (ridge / group-ridge) penalty weight, >= 0. Read by TENET, TENETAug and TIENETAug. Default 0.1, as inside the selectors. With 0 there is no quadratic penalty and the elastic nets reduce to their lasso.

rho_afs

TAFS shrinkage step in (0, 1]. Default 0.3, as inside the selectors; 1 is forward stepwise.

ncgmp_variant

TNCGMP variant: "line_search" (default) or "fully_corrective".

tenet_aug_use_lars

Logical; TENETAug and TIENETAug run the augmented system with a pure-LARS inner path that never drops variables (default FALSE: LASSO inner path).

tikhonov_validated

Logical; TIKNET and TCDTIKNET. TRUE says that the Tikhonov matrix was checked by the caller (finite entries, symmetric, positive semi-definite), and the solver skips its own check. For a caller that builds many solvers on one matrix, as the T-Rex selector does. Default FALSE.

kappa_dummy

Ridge weight of the dummy block of TCDENET, and of TCDTIKNET with fold_dummies = FALSE. Default 1. Deprecated: it will be removed with the coordinate-descent family in TRexSelector 2.1.0.

fold_dummies

Logical; TCDTIKNET dummy coupling. Default FALSE. Deprecated: it will be removed with the coordinate-descent family in TRexSelector 2.1.0.

group_penalty

TCDIENET structured penalty, "MEAN" (default) or "CENTERING". Deprecated: it will be removed with the coordinate-descent family in TRexSelector 2.1.0.

cd_lambda_rel_tol, cd_tol_certify, cd_tol_probe, cd_gram_cap, cd_max_sweeps, cd_certified_localization

Knobs of the coordinate-descent solver family; the defaults are the solver defaults (1e-3, 1e-10, 1e-8, 400, 2000, TRUE). A solve that stops at the sweep budget cd_max_sweeps far from a solution (KKT violation above 0.001 lambda_1) raises an error instead of continuing on an unconverged path. Deprecated: the six knobs will be removed with the coordinate-descent family in TRexSelector 2.1.0.

Value

A named list suitable for the options argument of every T-solver constructor.

In-place preprocessing (the writer/reader contract)

The T-solvers work on the caller's matrices without copying, in R as in C++ and Python. With normalize = TRUE or intercept = TRUE a solver is a writer: it centers / scales the columns of X and D in place (visible on the caller's matrix or memory-mapped file), keeps the statistics itself, and holds a claim on both until $restore() or garbage collection, both of which write X and D back; a second writer (T-solver or T-Rex selector) on a claimed matrix is an error, because a second in-place transformation moves the data by rounding. With normalize = FALSE and intercept = FALSE a solver is a reader that runs as constructed and never writes; a pipeline with several solvers on one matrix pre-scales once in front (MLLpNormScaler) and constructs readers. y is never written. See TSolver_Base.

See Also

Other T-solvers: TACGP_Solver, TAFS_Solver, TCDENET_Solver, TCDIENET_Solver, TCDLASSO_Solver, TCDTIKNET_Solver, TENETAug_Solver, TENET_Solver, TGP_Solver, TIENETAug_Solver, TIENET_Solver, TIKNET_Solver, TLARS_Solver, TLASSO_Solver, TMP_Solver, TNCGMP_Solver, TOMP_Solver, TOOLS_Solver, TSTAGEWISE_Solver, TSTEPWISE_Solver

Examples

tsolver_options()
tsolver_options(lambda2 = 0.5, normalize = FALSE)


TRexSelector documentation built on Nov. 20, 2026, 5:09 p.m.