Score specimens with a frozen graph-Fourier discriminator
Source:R/singlesample-graph-spectral-scorers.R
score_gsp_gft.RdScores each row of X independently with a frozen
gsp_gft_model. For each specimen, the scorer computes a per-sample
rCLR vector over the model features that are present in X, aligns that
vector to the frozen training feature universe with absent features set to 0,
projects it onto the frozen low-frequency graph-Fourier basis, applies the
frozen coordinate standardization, and evaluates the frozen linear head.
Arguments
- model
A
gsp_gft_modelobject returned byfit_gsp_gft.- X
Numeric matrix (samples \(\times\) features) of non-negative abundance values. Columns must be named feature ids.
- meta
Optional per-sample metadata. Accepted for interface uniformity and ignored by this method.
Value
Plain finite numeric vector of length nrow(X). Larger values
are more case-like. If fewer than model$hp$min_features model
features are present, the documented neutral score 0 is returned for
every row.
Details
The score of row \(i\) depends only on X[i, ] and the frozen model.
The scored batch contributes no centering, normalization, graph update,
bandwidth, basis, or head statistic. The rCLR representation is exactly
invariant to multiplying one specimen by a positive scalar, because
\(\log(c v_j) - mean_k \log(c v_k) = \log(v_j) - mean_k \log(v_k)\)
over that specimen's own positive entries.