Erro Quadrático Médio Logarítmico (MSLE) é uma função de perda commonly used in regression tasks, particularly when the target variable can vary across several orders of magnitude. MSLE is defined as the average of the squared differences between the logarithmic values of the predicted and actual values.
A fórmula para o MSLE pode ser expressa como:
MSLE = (1/n) * Σ (log(1 + y_true) – log(1 + y_pred))²
onde:
- y_true representa os valores reais.
- y_pred representa os valores previstos.
- n é o número de observações.
By taking the logarithm of the values, MSLE can effectively handle skewed distributions and is particularly useful in cases where we want to penalize underestimations more than overestimations. This property makes MSLE suitable for situations where the predicted values can be zero ou onde a escala dos dados varia amplamente.
O MSLE também possui vantagens em interpretability, as it measures the relative difference between the actual and predicted values. A lower MSLE indicates a better fit of the model to the data, while a higher MSLE signifies a poorer desempenho do modelo. In practice, MSLE is often preferred over Erro Quadrático Médio (MSE) when dealing with exponential growth scenarios or when the predictions are expected to be on a logarithmic scale.