Pairwise loss (for weighting/diagnostics)
Source:R/adapters_grasp.R, R/adapters_ot_procrustes.R, R/adapters_parrot.R, and 2 more
pair_loss.RdPairwise loss (for weighting/diagnostics)
Usage
# S3 method for class 'grasp_pair_fit'
pair_loss(fit, X_i = NULL, X_j = NULL, ...)
# S3 method for class 'ot_procrustes_pair_fit'
pair_loss(fit, X_i = NULL, X_j = NULL, ...)
# S3 method for class 'parrot_pair_fit'
pair_loss(fit, X_i = NULL, X_j = NULL, ...)
# S3 method for class 'token_ot_graph_pair_fit'
pair_loss(fit, X_i = NULL, X_j = NULL, ...)
pair_loss(fit, X_i = NULL, X_j = NULL, ...)Value
A single numeric value representing the pairwise alignment loss, or NA_real_ if not available.
Examples
# \donttest{
set.seed(1)
X1 <- matrix(rnorm(50), 25, 2)
X2 <- matrix(rnorm(50), 25, 2)
algo <- grasp_aligner()
fit <- fit_pair(algo, X1, X2)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'colSums': non-conformable matrix dimensions in .Arith.Csparse(e1, e2, .Generic, class. = "dgCMatrix")
loss <- pair_loss(fit)
# }