Regression Metrics

These functions are useful for the analysis of regression type of models, that deal with the continuous data. Metrics package provides the following metrics for the evaluation of regression models based on provided y_true and y_pred:

Metrics.maeFunction
mae(y_pred, y_true)

Mean Absolute Error. Calculated as sum(|y_true .- y_pred|) / length(y_true) based on provided y_pred and y_true.

Metrics.mseFunction
mse(y_pred, y_true)

Mean Squared Error. Calculated as sum((y_true .- y_pred).^2) / length(y_true) based on provided y_pred and y_true.

Metrics.maleFunction
male(y_pred, y_true)

Mean Absolute Logarithmic Error. Calculated as sum(|log.(y_true) .- log.(y_pred)|) / length(y_true) based on provided y_pred and y_true.

Metrics.msleFunction
msle(y_pred, y_true)

Mean Absolute Logarithmic Error. Calculated as sum((log.(y_true) .- log.(y_pred)).^2) / length(y_true) based on provided y_pred and y_true.

Metrics.r2_scoreFunction
r2_score(y_pred, y_true)

Calculates the r2 (Coefficient of Determination) score for the provided y_pred and y_true. Best possible score is 1.0 and it can be negative (because the model can be arbitrarily worse). A constant model that always predicts the expected value of y, disregarding the input features, would get a r2_score of 0.0.

Metrics.adjusted_r2_scoreFunction
adjusted_r2_score(y_pred, y_true, n)

Modified version of r2_score that has been adjusted for the number of predictors in the model. Here the argument n is for the number of predictors(or independent variables in X).

See also: r2_score