Contents

meanAbsoluteError(_:_:)

Computes the mean absolute error between predicted and ground truth values.

Declaration

@backDeployed(before: macOS 14.0, iOS 17.0, tvOS 17.0)
func meanAbsoluteError<T>(_ predicted: some Collection, _ groundTruth: some Collection) -> T where T : FloatingPoint

Parameters

  • predicted:

    The predicted values.

  • groundTruth:

    The ground truth values. The collection must have same number of elements as the predicted values.

Return Value

The mean absolute error.

Discussion

Empty collections of predicted and ground truth values will return a value of NaN.

See Also

Metrics