Cross-Validated Row-Wise Alignment Scoring
cv_alignment_rows.RdRuns explicit row-index cross-validation for multi-domain alignment models by
delegating fold construction and execution to multidesign::cv_rows() and
multidesign::cross_validate(). Held-out rows are scored by how similar
their cross-block neighbours are in an external feature space, using either
latent oos_predict projections or method-specific
predict(..., type = "weights") support when available.
Arguments
- data
A
hyperdesign-compatible object. Ifdatais not already a multidesign hyperdesign, it is coerced internally.- rows
Explicit held-out row specification forwarded to
multidesign::cv_rows(). For hyperdesigns, each fold should be a named list mapping block names or positions to held-out row indices.- fit_fn
Function taking the analysis split for a fold and returning a fitted alignment object.
- features
External feature matrices aligned to the original rows of each block. Supply either a named list of matrices, one per block, or a hyperdesign-compatible object whose
$xmatrices are treated as features.- k
Positive integer number of latent nearest neighbours used when scoring held-out rows.
- feature_similarity
Similarity used for the external feature space. Either
"cosine"(default) or"correlation".- target_pool
Which rows are available as retrieval targets for each held-out query block:
"analysis"(default) uses training rows from the fitted fold,"assessment"uses only other held-out rows, and"both"concatenates the two pools when latent projection is available.- prediction_mode
How neighbour rankings are produced.
"auto"(default) uses latentoos_predictprojection for embedding-oriented fits and preferspredict(..., type = "weights")for transport-style fits whentarget_pool = "analysis"."embedding"forces latent neighbour search and"weights"forces weight-based ranking against training targets.