Skip to main content
. 2025 Apr 4;22(4):562. doi: 10.3390/ijerph22040562
Algorithm 1 Performance metric algorithm.
Require: Dataset, Predictions, sklearn.metrics, and numpy libraries
  • 1:

    From sklearn.metrics, calculate r2_score, mape, and mse

  • 2:

    Normalize mse to calculate NRMSE

  • 3:

    Calculate WSM as the weighted sum of NRMSE, r2_score, and mape

  • 4:

    Return metrics to the main script

  • 5:

    for each country do

  • 6:

        for each metric do

  • 7:

            Identify the best and worst model in every metric

  • 8:

            if Metric is R2 then

  • 9:

               Inverse metric to (1R2)

  • 10:

            end if

  • 11:

            Use numpy.argsort to classify the results

  • 12:

            Save the data

  • 13:

        end for

  • 14:

    end for

  • 15:

    Report results