Skip to content

Problem with Classify vector by ROC #18

Description

@ernesto561

Thanks for the plugin. It's an easy way to create landslide susceptibility models. However, I have had problems running the tools.

I installed it in Windows 11 Pro from the QGIS plugin repository, using QGIS 3.44.1-Solothurn. When I try to run the tool "Classify vector by ROC", using the test data, I get the following error:

Input parameters:
{ 'INPUT' : 'C:/Users/mreyes.AMBIENTE/Downloads/SZ-plugin-master/test_data/out.gpkg|layername=out', 'NUMBER' : 4, 'OUTPUT3' : 'TEMPORARY_OUTPUT', 'STRING' : 'SI', 'STRING2' : 'y' }

Traceback (most recent call last):
File "C:\Users\mreyes.AMBIENTE\AppData\Roaming\QGIS\QGIS3\profiles\default\python\dependencies.sz_module20\Lib\site-packages\pandas\core\indexes\base.py", line 3812, in get_loc
return self._engine.get_loc(casted_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pandas/_libs/index.pyx", line 167, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 196, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 7088, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 7096, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'y'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users/mreyes.AMBIENTE/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\sz_module\sz_module_provider.py", line 434, in processAlgorithm
result=self.dict_of_scripts['function'].process(self,parameters, context, feedback)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users/mreyes.AMBIENTE/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\sz_module\scripts\classvector.py", line 107, in process
outputs['ga']=Functions.classy(alg_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users/mreyes.AMBIENTE/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\sz_module\scripts\classvector.py", line 150, in classy
y_true=np.array(df['y']).reshape(-1,1)
~~^^^^^
File "C:\Users\mreyes.AMBIENTE\AppData\Roaming\QGIS\QGIS3\profiles\default\python\dependencies.sz_module20\Lib\site-packages\pandas\core\frame.py", line 4113, in getitem
indexer = self.columns.get_loc(key)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mreyes.AMBIENTE\AppData\Roaming\QGIS\QGIS3\profiles\default\python\dependencies.sz_module20\Lib\site-packages\pandas\core\indexes\base.py", line 3819, in get_loc
raise KeyError(key) from err
KeyError: 'y'

Execution failed after 0.42 seconds

It's the same error for the tool "ROC".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions