performance {DMTL} | R Documentation |
This function produces the predictive performance for a regression model using various common performance metrics such as MSE, R-squared, or Correlation coefficients.
performance(y_obs, y_pred, measures = c("NRMSE", "NMAE", "PCC"))
y_obs |
Observed response values |
y_pred |
Predicted response values |
measures |
Performance measures. One can specify a single measure or a vector containing multiple measures in terms of common error or similarity metrics. The available options are roughly divided into 3 categories -
Defaults to |
A vector containing the performance metric values.
set.seed(654321)
x <- rnorm(1000, 0.2, 0.5)
y <- x^2 + rnorm(1000, 0, 0.1)
y_fit <- predict(lm(y ~ x))
print(performance(y, y_fit, measures = c("MSE", "RSQ")))