Skip to contents

Setup hyperparameters for Sparse Partial Least Squares training.

Usage

setup_SPLS(
  k = 2L,
  eta = 0.5,
  kappa = 0.5,
  select = "pls2",
  fit = "simpls",
  classifier = "lda",
  scale_x = TRUE,
  scale_y = FALSE,
  eps = 1e-04,
  maxstep = 100L,
  ifw = FALSE
)

Arguments

k

(Tunable) Integer [1, Inf): Number of latent components.

eta

(Tunable) Numeric [0, 1): Sparsity threshold. Higher values select fewer features.

kappa

(Tunable) Numeric [0, 0.5]: Concavity of the surrogate direction vector problem.

select

Character {"pls2", "simpls"}: Feature selection algorithm (regression only).

fit

Character {"kernelpls", "widekernelpls", "simpls", "oscorespls"}: PLS algorithm used for model fitting (regression only).

classifier

Character {"lda", "logistic"}: Classifier fit on the latent components (classification only).

scale_x

Logical: If TRUE, scale features to unit variance.

scale_y

Logical: If TRUE, scale the outcome to unit variance (regression only).

eps

Numeric (0, Inf): Convergence tolerance (regression only).

maxstep

Integer [1, Inf): Maximum number of iterations per component (regression only).

ifw

(Tunable) Logical: If TRUE, use Inverse Frequency Weighting in classification.

Value

SPLSHyperparameters object.

Details

Regression is fit with spls::spls and classification with spls::splsda, chosen from the outcome type. Parameters marked "regression only" or "classification only" are passed to the backend that accepts them and ignored by the other.

spls provides no case weights, so ifw cannot be honored: enabling it makes training abort rather than silently fit an unweighted model.

Author

EDG

Examples

spls_hyperparams <- setup_SPLS(k = 3L, eta = 0.7)
spls_hyperparams
#> <SPLSHyperparameters>
#>         hyperparameters: 
#>                                   k: <int> 3
#>                                 eta: <nmr> 0.70
#>                               kappa: <nmr> 0.50
#>                              select: <chr> pls2
#>                                 fit: <chr> simpls
#>                          classifier: <chr> lda
#>                             scale_x: <lgc> TRUE
#>                             scale_y: <lgc> FALSE
#>                                 eps: <nmr> 1e-04
#>                             maxstep: <int> 100
#>                                 ifw: <lgc> FALSE
#> tunable_hyperparameters: <chr> k, eta, kappa, ifw
#>   fixed_hyperparameters: <chr> select, fit, classifier, scale_x, scale_y, eps, maxstep
#>                   tuned: <int> -1
#>               resampled: <int> 0
#>               n_workers: <int> 1
#> 
#>   No search values defined for tunable hyperparameters.