% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/metrics.R
\name{r2_mtl}
\alias{r2_mtl}
\title{Coefficient of Determination (R-squared) for Multi-Task Regression}
\usage{
r2_mtl(true.label.mat, pred.label.mat)
}
\arguments{
\item{true.label.mat}{A numeric matrix of true responses
(\code{n x numTasks}). \code{NA} cells are ignored.}

\item{pred.label.mat}{A numeric matrix of predictions of the same
dimensions (as produced by \code{\link{predict.orthoMTL}}).}
}
\value{
A single numeric value (higher is better; 1 = perfect).
  Can be negative when predictions are worse than the mean.
}
\description{
Pooled \eqn{R^2 = 1 - SS_{res} / SS_{tot}} over every non-\code{NA}
cell, for \code{orthoMTL} fits in regression mode. \eqn{SS_{tot}} uses
the global mean of the pooled true values.
}
\examples{
set.seed(1)
Y <- matrix(rnorm(30), 10, 3)
P <- Y + matrix(rnorm(30, sd = 0.1), 10, 3)
r2_mtl(Y, P)
}
\seealso{
\code{\link{rmse_mtl}}, \code{\link{cindex_mtl}}
}
