performance {DMTL} | R Documentation |
Evaluate Regression Model Performance using Various Metrics
Description
This function produces the predictive performance for a regression model using various common performance metrics such as MSE, R-squared, or Correlation coefficients.
Usage
performance(y_obs, y_pred, measures = c("NRMSE", "NMAE", "PCC"))
Arguments
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 |
Value
A vector containing the performance metric values.
Examples
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")))