-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
r.confusionmatrix: Support usage of a single class in reference (#409)
* add handling for single class * remove unnecessary line printing * add test * change csv.writer linedelimiter to `\n`
- Loading branch information
1 parent
3b61e41
commit 076ca29
Showing
4 changed files
with
77 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 19 additions & 19 deletions
38
grass7/raster/r.confusionmatrix/testsuite/data/confusionmatrix_raster_matrix.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
,,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 | ||
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 | ||
,Managed Herbaceous Cover,0,0,25488,0,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Upland Herbaceous,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Riverine/Estuarine Herbaceous,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Evergreen Shrubland,0,0,0,16464,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Deciduous Shrubland,0,0,0,320,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Mixed Shrubland,0,0,0,45,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Mixed Hardwoods,0,0,0,0,7893,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Bottomland Hardwoods/Hardwood Swamps,0,0,0,0,19733,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Southern Yellow Pine,0,0,0,0,64774,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Mixed Hardwoods/Conifers,0,0,0,0,33865,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Water Bodies,0,0,0,0,0,5303,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Unconsolidated Sediment,0,0,0,0,0,0,194,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Producer Accuracy,47.800265473404764,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,Overall Accuracy,14.010340000721955 | ||
,Omission Error,52.199734526595236,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,Kappa coefficient,0.09464798548745997 | ||
,,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 | ||
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 | ||
,Managed Herbaceous Cover,0,0,25488,0,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Upland Herbaceous,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Riverine/Estuarine Herbaceous,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Evergreen Shrubland,0,0,0,16464,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Deciduous Shrubland,0,0,0,320,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Mixed Shrubland,0,0,0,45,0,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Mixed Hardwoods,0,0,0,0,7893,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Bottomland Hardwoods/Hardwood Swamps,0,0,0,0,19733,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Southern Yellow Pine,0,0,0,0,64774,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Mixed Hardwoods/Conifers,0,0,0,0,33865,0,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Water Bodies,0,0,0,0,0,5303,0,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Unconsolidated Sediment,0,0,0,0,0,0,194,0,0,0,0,0,0,0,0,0.0,100.0 | ||
,Producer Accuracy,47.8,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,Overall Accuracy,14.01 | ||
,Omission Error,52.2,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,100.0,Kappa coefficient,0.09 |
6 changes: 6 additions & 0 deletions
6
grass7/raster/r.confusionmatrix/testsuite/data/confusionmatrix_raster_matrix_oneclass.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
,,Reference Map,landclass96_class1only | ||
,,Class_0,User Accuracy,Commission Error | ||
Classified Map,Class_0,73077,100.0,0.0 | ||
landuse96_28m_class1only,,,, | ||
,Producer Accuracy,100.0,Overall Accuracy,100.0 | ||
,Omission Error,0.0,Kappa coefficient,nan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters