r2_mtl: Coefficient of Determination (R-squared) for Multi-Task...

View source: R/metrics.R

r2_mtlR Documentation

Coefficient of Determination (R-squared) for Multi-Task Regression

Description

Pooled R^2 = 1 - SS_{res} / SS_{tot} over every non-NA cell, for orthoMTL fits in regression mode. SS_{tot} uses the global mean of the pooled true values.

Usage

r2_mtl(true.label.mat, pred.label.mat)

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).

Value

A single numeric value (higher is better; 1 = perfect). Can be negative when predictions are worse than the mean.

See Also

rmse_mtl, cindex_mtl

Examples

set.seed(1)
Y <- matrix(rnorm(30), 10, 3)
P <- Y + matrix(rnorm(30, sd = 0.1), 10, 3)
r2_mtl(Y, P)

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