mean_squared_log_error

Function mean_squared_log_error 

Source
pub fn mean_squared_log_error<F, S1, S2, D1, D2>(
    y_true: &ArrayBase<S1, D1>,
    y_pred: &ArrayBase<S2, D2>,
) -> Result<F>
where F: Float + NumCast + Debug + SimdUnifiedOps, S1: Data<Elem = F>, S2: Data<Elem = F>, D1: Dimension, D2: Dimension,
Expand description

Calculates the mean squared logarithmic error (MSLE)

Mean squared logarithmic error measures the average squared difference between the logarithm of the predicted and true values. This metric penalizes underestimates more than overestimates.

§Arguments

  • y_true - Ground truth (correct) target values
  • y_pred - Estimated target values

§Returns

  • The mean squared logarithmic error

§Notes

  • This metric cannot be used with negative values

§Examples

use scirs2_core::ndarray::array;
use scirs2_metrics::regression::mean_squared_log_error;

let y_true = array![3.0, 5.0, 2.5, 7.0];
let y_pred = array![2.5, 5.0, 3.0, 8.0];

let msle = mean_squared_log_error(&y_true, &y_pred).unwrap();
assert!(msle > 0.0);