mtr_explained_variance: Explained Variance

Description Usage Arguments Value Author(s) See Also Examples

View source: R/regression.r

Description

mtr_explained_variance computes explained variance, also known as explained variation, which is interpreted as the percentage of variation in one numeric vector explained by another. The best possible score is 1.0, lower values are worse.

Usage

1
mtr_explained_variance(actual, predicted)

Arguments

actual

[numeric] The ground truth numeric vector.

predicted

[numeric] The predicted numeric vector, where each element in the vector is a prediction of the corresponding elements in actual.

Value

A numeric scalar output

Author(s)

An Chu

See Also

mtr_r2

Examples

1
2
3
4
5
6
7
act <- c(3, -0.5, 2, 7)
pred <- c(2.5, 0.0, 2, 8)
mtr_explained_variance(act, pred)

act <- c(1.1, 1.9, 3.0, 4.4, 5.0, 5.6)
pred <- c(0.9, 1.8, 2.5, 4.5, 5.0, 6.2)
mtr_explained_variance(act, pred)

chuvanan/metrics documentation built on Nov. 4, 2019, 8:52 a.m.