Compute the mean squared 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 squared error
pure function mse_score(predicted, expected) result(output) !! Compute the mean squared 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 squared error ! Compute the accuracy output = 1._real32 - & sum((expected - predicted)**2._real32,dim=1)/size(expected,1) end function mse_score