accuracy_mtl: Classification Accuracy for Multi-Task Predictions

View source: R/metrics.R

accuracy_mtlR Documentation

Classification Accuracy for Multi-Task Predictions

Description

Pooled fraction of correctly classified non-NA cells, for orthoMTL fits in classification mode (logistic = TRUE). A cell is positive when its true label is > 0 and predicted positive when its score is > 0. This works for both the \{-1, +1\} encoding the solver optimises and a \{0, 1\} encoding, and for raw "link" scores or "response" probabilities (threshold 0.5 corresponds to a link of 0... see note).

Usage

accuracy_mtl(true.label.mat, pred.label.mat, threshold = 0)

Arguments

true.label.mat

A numeric matrix of true responses (n x numTasks). NA cells are ignored.

pred.label.mat

A numeric matrix of predictions of the same dimensions (as produced by predict.orthoMTL).

threshold

Decision threshold applied to pred.label.mat. Default 0 matches raw link scores; pass 0.5 for probabilities from predict(..., type = "response").

Value

A single numeric value in [0, 1] (higher is better).

See Also

auc_mtl, cindex_mtl

Examples

set.seed(1)
Y <- matrix(sample(c(-1, 1), 30, replace = TRUE), 10, 3)
P <- Y * abs(matrix(rnorm(30), 10, 3))   # mostly correct signs
accuracy_mtl(Y, P)

orthoMTL documentation built on Aug. 23, 2026, 5:10 p.m.