From 5f03793d54ae46a263b59f74a4d624c4f0826f01 Mon Sep 17 00:00:00 2001 From: anikaweinmann Date: Tue, 17 Jan 2023 14:51:12 +0100 Subject: [PATCH 1/2] change result data after r.kappa change --- src/raster/r.confusionmatrix/r.confusionmatrix.html | 4 ++-- src/raster/r.confusionmatrix/r.confusionmatrix.py | 8 ++++---- .../testsuite/data/confusionmatrix_raster_matrix.csv | 2 +- .../data/confusionmatrix_raster_matrix_oneclass.csv | 4 ++-- .../r.confusionmatrix/testsuite/test_r_confusionmatrix.py | 5 ++--- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/raster/r.confusionmatrix/r.confusionmatrix.html b/src/raster/r.confusionmatrix/r.confusionmatrix.html index d4c2de6a9b..edea559efa 100644 --- a/src/raster/r.confusionmatrix/r.confusionmatrix.html +++ b/src/raster/r.confusionmatrix/r.confusionmatrix.html @@ -7,7 +7,7 @@

DESCRIPTION

NOTES

The reference can be a raster map raster_reference or a vector map -vector_reference with a column containing the class labels as +vector_reference with a column containing the class labels as integer numbers.

In case of vector reference, this map is rasterized according to the extent and @@ -30,4 +30,4 @@

SEE ALSO

AUTHOR

-Anika Bettge, mundialis GmbH & Co. KG +Anika Weinmann, mundialis GmbH & Co. KG diff --git a/src/raster/r.confusionmatrix/r.confusionmatrix.py b/src/raster/r.confusionmatrix/r.confusionmatrix.py index 64e484fd89..0c9effec06 100644 --- a/src/raster/r.confusionmatrix/r.confusionmatrix.py +++ b/src/raster/r.confusionmatrix/r.confusionmatrix.py @@ -2,13 +2,13 @@ ############################################################################ # -# MODULE: r.confusionmatrix +# MODULE: r.confusionmatrix # -# AUTHOR(S): Anika Bettge +# AUTHOR(S): Anika Weinmann # -# PURPOSE: Calculates a confusion matrix and accuracies for a given classification using r.kappa. +# PURPOSE: Calculates a confusion matrix and accuracies for a given classification using r.kappa. # -# COPYRIGHT: (C) 2020 by mundialis and the GRASS Development Team +# COPYRIGHT: (C) 2020 by mundialis and the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2). Read the file COPYING that comes with GRASS diff --git a/src/raster/r.confusionmatrix/testsuite/data/confusionmatrix_raster_matrix.csv b/src/raster/r.confusionmatrix/testsuite/data/confusionmatrix_raster_matrix.csv index e1d3b7a7b1..ca0aa7513a 100644 --- a/src/raster/r.confusionmatrix/testsuite/data/confusionmatrix_raster_matrix.csv +++ b/src/raster/r.confusionmatrix/testsuite/data/confusionmatrix_raster_matrix.csv @@ -1,5 +1,5 @@ ,,Reference Map,landclass96 -,,developed,agriculture,herbaceous,shrubland,forest,water,sediment,Class_7,Class_8,Class_9,Class_10,Class_11,Class_12,Class_13,Class_14,User Accuracy,Commission Error +,,developed,agriculture,herbaceous,shrubland,forest,water,sediment,8,9,10,11,15,18,20,21,User Accuracy,Commission Error Classified Map,High Intensity Developed,34931,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100.0,0.0 landuse96_28m,Low Intensity Developed,38146,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 ,Cultivated,0,2137,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 diff --git a/src/raster/r.confusionmatrix/testsuite/data/confusionmatrix_raster_matrix_oneclass.csv b/src/raster/r.confusionmatrix/testsuite/data/confusionmatrix_raster_matrix_oneclass.csv index 0cf5719583..497ffa01fd 100644 --- a/src/raster/r.confusionmatrix/testsuite/data/confusionmatrix_raster_matrix_oneclass.csv +++ b/src/raster/r.confusionmatrix/testsuite/data/confusionmatrix_raster_matrix_oneclass.csv @@ -1,6 +1,6 @@ ,,Reference Map,landclass96_class1only -,,Class_0,User Accuracy,Commission Error -Classified Map,Class_0,73077,100.0,0.0 +,,1,User Accuracy,Commission Error +Classified Map,1,73077,100.0,0.0 landuse96_28m_class1only,,,, ,Producer Accuracy,100.0,Overall Accuracy,100.0 ,Omission Error,0.0,Kappa coefficient,nan diff --git a/src/raster/r.confusionmatrix/testsuite/test_r_confusionmatrix.py b/src/raster/r.confusionmatrix/testsuite/test_r_confusionmatrix.py index b86c6145ce..06f1d8a88f 100644 --- a/src/raster/r.confusionmatrix/testsuite/test_r_confusionmatrix.py +++ b/src/raster/r.confusionmatrix/testsuite/test_r_confusionmatrix.py @@ -2,8 +2,8 @@ Name: r.confusionmatrix test Purpose: Tests r.confusionmatrix input parsing. Uses NC full sample data set. -Author: Anika Bettge -Copyright: (C) 2020 Anika Bettge, mundialis, and the GRASS Development Team +Author: Anika Weinmann +Copyright: (C) 2020-2023 Anika Weinmann, mundialis, and the GRASS Development Team Licence: This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details. @@ -67,7 +67,6 @@ def test_confusionmatrix_with_raster_reference(self): # check to see if output file exists self.assertFileExists(self.output_csv, msg="Output file does not exist") # check if the output file is equal to the reference file - self.assertFilesEqualMd5( self.output_csv, "data/confusionmatrix_raster_matrix.csv", From f43896b2949f3e05a7cca28a491694fb37d95c33 Mon Sep 17 00:00:00 2001 From: Markus Neteler Date: Sun, 29 Jan 2023 19:08:19 +0100 Subject: [PATCH 2/2] minor wording --- src/raster/r.confusionmatrix/r.confusionmatrix.html | 2 +- src/raster/r.confusionmatrix/r.confusionmatrix.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raster/r.confusionmatrix/r.confusionmatrix.html b/src/raster/r.confusionmatrix/r.confusionmatrix.html index edea559efa..90b05cc1bf 100644 --- a/src/raster/r.confusionmatrix/r.confusionmatrix.html +++ b/src/raster/r.confusionmatrix/r.confusionmatrix.html @@ -30,4 +30,4 @@

SEE ALSO

AUTHOR

-Anika Weinmann, mundialis GmbH & Co. KG +Anika Weinmann, mundialis GmbH & Co. KG diff --git a/src/raster/r.confusionmatrix/r.confusionmatrix.py b/src/raster/r.confusionmatrix/r.confusionmatrix.py index 0c9effec06..c22ecfee60 100644 --- a/src/raster/r.confusionmatrix/r.confusionmatrix.py +++ b/src/raster/r.confusionmatrix/r.confusionmatrix.py @@ -8,7 +8,7 @@ # # PURPOSE: Calculates a confusion matrix and accuracies for a given classification using r.kappa. # -# COPYRIGHT: (C) 2020 by mundialis and the GRASS Development Team +# COPYRIGHT: (C) 2020-2023 by mundialis and the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2). Read the file COPYING that comes with GRASS