[Classification Workflow] Problems when using id (integer) field with labels

Issue #1321 resolved
Fabian Thiel created an issue

When using a renderer option where a classification id and a label is given (see example data link below) I get the following error:
The contents/categories of the created dataset look correct. I am not sure what the problem is actually, so issue title might be misleading.

Data link https://nextcloud.uni-greifswald.de/index.php/s/zY7FdNnwo6QkaEC

Traceback (most recent call last):
File "C:\Users/fabian/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "C:\Users/fabian/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxprocessing\algorithm\fitclassifieralgorithmbase.py", line 88, in processAlgorithm
classifier.fit(dump.X, dump.y.ravel())
File "C:\OSGeo4W\apps\Python39\lib\site-packages\sklearn\ensemble\_forest.py", line 327, in fit
X, y = self._validate_data(
File "C:\OSGeo4W\apps\Python39\lib\site-packages\sklearn\base.py", line 581, in _validate_data
X, y = check_X_y(X, y, **check_params)
File "C:\OSGeo4W\apps\Python39\lib\site-packages\sklearn\utils\validation.py", line 964, in check_X_y
X = check_array(
File "C:\OSGeo4W\apps\Python39\lib\site-packages\sklearn\utils\validation.py", line 805, in check_array
raise ValueError(
ValueError: Found array with 0 sample(s) (shape=(0, 6)) while a minimum of 1 is required.

Execution failed after 0.11 seconds

Another error, when I try to inspect the dataset in the data sources tab I get the following error:

An error has occurred while executing Python code:

ValueError: zero-size array to reduction operation minimum which has no identity

Traceback (most recent call last):
  File "C:\Users/fabian/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\qgispluginsupport\qps\models.py", line 1043, in fetchMore
    node.fetch()
  File "C:\Users/fabian/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\qgispluginsupport\qps\models.py", line 832, in fetch
    newNodes.append(self.__class__(name=str(k), obj=v))
  File "C:\Users/fabian/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\qgispluginsupport\qps\models.py", line 764, in __init__
    subnodes.append(TreeNode('min', value=obj.min()))
  File "C:\OSGeo4W\apps\Python39\lib\site-packages\numpy\core\_methods.py", line 43, in _amin
    return umr_minimum(a, axis, None, out, keepdims, initial, where)
ValueError: zero-size array to reduction operation minimum which has no identity

Comments (2)

  1. Log in to comment