| trex_normalize_design | R Documentation |
The selectors' own preprocessing as a user-callable helper:
the same code path a selector runs at construction for the given
scaling_mode. Use it to pre-normalize a design and then run a
selector with trex_control(scaling_mode = "NONE") (the selection
is identical to running the raw design under "L2"), to inspect
the centering and scaling parameters, or to validate a design before a
long run. The inputs are copied and left untouched.
trex_normalize_design(
X,
y,
scaling_mode = c("L2", "ZSCORE", "NONE"),
eps = 1e-06,
n_threads = NULL
)
X |
Numeric design matrix (n x p). |
y |
Numeric response vector (length n). |
scaling_mode |
One of |
eps |
Dead-column threshold on the working L2 norm (default 1e-6, the selectors' default solver tolerance). |
n_threads |
Integer, the thread budget of the column passes
( |
Errors on a non-finite entry or a dead column (constant under
"L2" / "ZSCORE", all-zero under "NONE"), naming
the column (0-based, as reported by the C++ core).
A list with X and y (the normalized copies),
X_means, X_scales (the per-column divisors: L2 norms for
"L2", sample SDs for "ZSCORE", ones for "NONE") and
y_mean.
Other T-Rex selectors and controls:
Gauss_data,
TRexBiobankScreeningSelector,
TRexDASelector,
TRexGVSSelector,
TRexSPCASelector,
TRexScreeningSelector,
TRexSelector,
TRexTikhonovSelector,
trex_biobank_control(),
trex_build_group_centering_k(),
trex_control(),
trex_da_control(),
trex_default_lambda2_grid(),
trex_dummy_distribution(),
trex_fdp(),
trex_fdp_dense(),
trex_gamma_to_k(),
trex_get_num_threads(),
trex_gvs_control(),
trex_gvs_lambda2_power_rule(),
trex_precision(),
trex_recall(),
trex_screen_control(),
trex_spca_control(),
trex_tikhonov_control(),
trex_tikhonov_lambda2_power_rule(),
trex_tpp(),
trex_tpp_dense()
set.seed(1)
X <- matrix(rnorm(200), 40, 5)
y <- X[, 1] + rnorm(40)
d <- trex_normalize_design(X, y)
colMeans(d$X) # ~ 0
sqrt(colSums(d$X^2)) # 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.