Compute the mean absolute error of a model
This function is only valid for continuous datasets
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in), | dimension(:,:) | :: | predicted |
Predicted and expected values |
|
| real(kind=real32), | intent(in), | dimension(:,:) | :: | expected |
Predicted and expected values |
Mean absolute error
pure function mae_score(predicted, expected) result(output) !! Compute the mean absolute error of a model !! !! This function is only valid for continuous datasets implicit none ! Arguments real(real32), dimension(:,:), intent(in) :: predicted, expected !! Predicted and expected values real(real32), dimension(size(expected,2)) :: output !! Mean absolute error ! Compute the accuracy output = 1._real32 - sum(abs(expected - predicted),dim=1)/size(expected,1) end function mae_score