Fit REO-singscore within-sample rank discriminator
Source:R/singlesample-reo-scorers.R
fit_reo_singscore.RdLearns a frozen up/down feature signature from training data using
within-sample fractional ranks, then stores only that signature and fixed
hyperparameters for single-sample singscore-style scoring. Training ranks are
computed per sample with ascending ranks divided by the training feature
count; higher fractional rank means higher abundance in that sample. A
feature elevated in cases therefore has a higher mean case fractional rank
than control fractional rank, and is selected by
mean_fracrank_cases - mean_fracrank_controls. No test data or
test-time batch statistics are used.
Usage
fit_reo_singscore(X_train, y_train, meta_train = NULL, hp = list())Arguments
- X_train
Numeric matrix (samples \(\times\) features) of non-negative abundance values. Columns must be uniquely named feature ids.
- y_train
Integer/numeric 0/1 labels aligned to
X_train; 1 is case/disease and 0 is control.- meta_train
Optional per-sample metadata. Accepted for interface uniformity and ignored by this method.
- hp
List of frozen hyperparameters:
ksignature size per direction (defaultmin(25L, floor(ncol(X_train) / 4)), at least 1) anduse_downlogical (defaultTRUE). These are resolved once during fitting and are not tuned insidefit_reo_singscore().
Value
A plain list of class reo_singscore_model containing
up_features, down_features, feature_universe,
use_down, k, and the resolved hp.