R/transferable_features.R
select_transferable_features.RdFits ridge-penalised logistic regression models for each cohort and selects features whose coefficients are both large in magnitude and consistent across cohorts. This emphasises biomarkers that deliver transferable signal.
select_transferable_features(
x_list,
y_list,
n_features = 50L,
lambda = NULL,
lambda_choice = c("lambda_1se", "lambda_min"),
min_coefficient = 0,
require_sign_consistency = TRUE,
sign_consistency_threshold = 1,
standardize = TRUE,
assay = NULL
)A matrix-like object, SummarizedExperiment, or list of such
objects. Rows represent samples and columns represent features.
A binary response aligned with x_list. Must be a factor with
levels c("No", "Yes"). Provide a list when x_list is a list.
Maximum number of features to return (default 50).
Optional penalty parameter supplied to glmnet::glmnet(). When
NULL, cohort-specific values are chosen via cross-validation.
When lambda is NULL, choose either "lambda_1se"
(default) or "lambda_min" from glmnet::cv.glmnet() as the operating
point for coefficient extraction.
Minimum absolute coefficient required (applied to the cohort-wise minimum magnitude) before a feature is considered transferable.
If TRUE, only retain features whose ridge
coefficients meet the sign_consistency_threshold across cohorts. Note
that FALSE is equivalent to sign_consistency_threshold = 0: sign
agreement is a non-negative fraction, so a zero threshold never filters.
Minimum fraction of cohorts that must agree on coefficient sign direction (default 1.0 requires 100% agreement). Set to values like 0.75 to allow partial sign consistency.
Logical; passed to glmnet::glmnet() to control feature
standardisation prior to fitting. Defaults to TRUE.
For SummarizedExperiment inputs, the assay name or index to
extract prior to modelling.
A list containing the selected feature identifiers, per-feature scoring metadata, coefficient matrix, and the lambda value used for each cohort.
Features are aligned across cohorts via intersection of shared
column names. For more flexible alignment strategies (e.g., majority
voting or median imputation), use the feature_alignment parameter
in optimize_panel().