In the
following description of the currently available metrics we denote the
vector of true target variable values as t, the vector of predictions
by p, while N denotes the size of these two vectors, i.e. the number
of test cases. The regression evaluation statistics calculated by this function belong
to two different groups of measures: absolute and relative. In terms of
absolute error metrics the function includes currently the following:
"mae": mean absolute error, which is calculated as sum(|t_i - p_i|)/N
"mse": mean squared error, which is calculated as sum( (t_i - p_i)^2
)/N
"rmse": root mean squared error that is calculated as sqrt(mse)
The remaining measures ("mape", "nmse", "nmae" and "theil") are relative
measures, the three later
comparing the performance of the model with a baseline. They are
unit-less measures with values always greater than 0. In the case of
"nmse", "nmae" and "theil" the values are expected to be in the interval [0,1]
though occasionaly scores can overcome 1, which means that your model
is performing worse than the baseline model. The baseline used in both
"nmse" and "nmae" is a constant model that always predicts the average
target variable value, estimated using the values of this variable on
the training data (data used to obtain the model that generated the
predictions), which should be
provided in the parameter train.y
. The "theil" metric is
typically used in time series tasks and the used baseline is the last
observed value of the target variable. The relative error measure
"mape" does not require a baseline. It simply calculates the average
percentage difference between the true values and the
predictions.
These measures are calculated as follows:
"mape": sum(|(t_i - p_i) / t_i|)/N
"nmse": sum( (t_i - p_i)^2 ) / sum( (t_i - AVG(Y))^2 ), where AVG(Y)
is the average of the values provided in vector train.y
"nmae": sum(|t_i - p_i|) / sum(|t_i - AVG(Y)|)
"theil": sum( (t_i - p_i)^2 ) / sum( (t_i - t_{i-1})^2 ), where
t_{i-1} is the last observed value of the target variable
The user may also indicate the value "all" in the parameter
metrics
. In this case all possible metrics will be
calculated. This will only include the "nmse", "nmae" and "theil" metrics if
the value of the train.y
parameter is set, otherwise only the
other metrics will be returned.