Learn R Programming

thisutils (version 0.0.7)

r_square: coefficient of determination (\(R^2\))

Description

coefficient of determination (\(R^2\))

Usage

r_square(y_true, y_pred)

Value

\(R^2\) value

Arguments

y_true

A numeric vector with ground truth values.

y_pred

A numeric vector with predicted values.

Examples

Run this code
y <- rnorm(100)
y_pred <- y + rnorm(100, sd = 0.5)
r_square(y, y_pred)

Run the code above in your browser using DataLab