issue with classification accuracy assessment

Issue #902 resolved
Andreas Janz created an issue

Reported by Katja Kowalski.

After styling the predicted and observed layer, the Classification layer accuracy and area report algorithms gives an error.

Algorithm 'Classification layer accuracy and area report (for simple random sampling)' starting…

Input parameters:

{ 'classification' : 'C:/Users/Andreas/Downloads/SE_data/rf_classification_v2.bsq', 'openReport' : True, 'outClassificationPerformance' : 'TEMPORARY_OUTPUT', 'reference' : 'C:/Users/Andreas/Downloads/SE_data/validation_data.shp' }

Traceback (most recent call last):
File "D:\source\QGISPlugIns\enmap-box\site-packages\typeguard\__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "D:\source\QGISPlugIns\enmap-box\enmapboxprocessing\algorithm\classificationperformancestratifiedalgorithm.py", line 186, in processAlgorithm
stats = stratifiedAccuracyAssessment(stratum, yReference, yMap, h, N_h, classValues, classNames)
File "D:\source\QGISPlugIns\enmap-box\site-packages\typeguard\__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "D:\source\QGISPlugIns\enmap-box\enmapboxprocessing\algorithm\classificationperformancestratifiedalgorithm.py", line 323, in stratifiedAccuracyAssessment
stats = aa_stratified(stratum, reference, map, h, N_h, classValues)
File "D:\source\QGISPlugIns\enmap-box\site-packages\typeguard\__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "D:\source\QGISPlugIns\enmap-box\enmapboxprocessing\algorithm\classificationperformancestratifiedalgorithm.py", line 348, in aa_stratified
assert set(h) == set(stratum), f'empty strata detected: {set(h) - set(stratum)}'
AssertionError: empty strata detected: {1}

Execution failed after 0.90 seconds

Comments (3)

  1. Andreas Janz reporter

    As a workaround: for both layers, save the styles as default styles:

    This prevents the error.

  2. Log in to comment