AttributeError: 'RandomForestRegressor' object has no attribute 'min_impurity_split'
Issue #1324
on hold
AttributeError is raised when openen the Example Test data:
How to reproduce: run test_instance_coreapps_and_data
in tests/src/test_enmapbox.py
Traceback:
Traceback (most recent call last):
File "C:\Users\geo_beja\Repositories\enmap-box\tests\src\test_enmapbox.py", line 171, in test_instance_coreapps_and_data
EMB.openExampleData(mapWindows=1, testData=True)
File "C:\Users\geo_beja\Repositories\enmap-box\enmapbox\gui\enmapboxgui.py", line 1725, in openExampleData
self.addSources(files)
File "C:\Users\geo_beja\Repositories\enmap-box\enmapbox\gui\enmapboxgui.py", line 1914, in addSources
return self.mDataSourceManager.addDataSources(sourceList)
File "C:\Users\geo_beja\Repositories\enmap-box\enmapbox\gui\datasources\manager.py", line 268, in addDataSources
sources = DataSourceFactory.create(sources, provider=provider, name=name)
File "C:\Users\geo_beja\Repositories\enmap-box\enmapbox\gui\datasources\manager.py", line 839, in create
results.extend(DataSourceFactory.create(s, provider=provider, name=name))
File "C:\Users\geo_beja\Repositories\enmap-box\enmapbox\gui\datasources\manager.py", line 931, in create
results.append(ModelDataSource(dataItem))
File "C:\Users\geo_beja\Repositories\enmap-box\enmapbox\gui\datasources\datasources.py", line 255, in __init__
self.updateNodes()
File "C:\Users\geo_beja\Repositories\enmap-box\enmapbox\gui\datasources\datasources.py", line 287, in updateNodes
self.mObjectNode = PyObjectTreeNode(obj=self.mPklObject, name='Content')
File "C:\Users\geo_beja\Repositories\enmap-box\enmapbox\qgispluginsupport\qps\models.py", line 773, in __init__
value = str(obj)
File "F:\OSGeo4W\apps\Python39\lib\site-packages\sklearn\base.py", line 260, in __repr__
repr_ = pp.pformat(self)
File "F:\OSGeo4W\apps\Python39\lib\pprint.py", line 153, in pformat
self._format(object, sio, 0, 0, {}, 0)
File "F:\OSGeo4W\apps\Python39\lib\pprint.py", line 170, in _format
rep = self._repr(object, context, level)
File "F:\OSGeo4W\apps\Python39\lib\pprint.py", line 431, in _repr
repr, readable, recursive = self.format(object, context.copy(),
File "F:\OSGeo4W\apps\Python39\lib\site-packages\sklearn\utils\_pprint.py", line 180, in format
return _safe_repr(object, context, maxlevels, level,
File "F:\OSGeo4W\apps\Python39\lib\site-packages\sklearn\utils\_pprint.py", line 425, in _safe_repr
params = _changed_params(object)
File "F:\OSGeo4W\apps\Python39\lib\site-packages\sklearn\utils\_pprint.py", line 91, in _changed_params
params = estimator.get_params(deep=False)
File "F:\OSGeo4W\apps\Python39\lib\site-packages\sklearn\base.py", line 195, in get_params
value = getattr(self, key)
AttributeError: 'RandomForestRegressor' object has no attribute 'min_impurity_split'
Comments (5)
-
reporter -
- changed milestone to 3.10 (Hotfix)
-
assigned issue to
-
I can’t reproduce the
AttributeError
nor the modul import error.Box looks like this after running the test:
-
Please provide a minimalistic example, loading only a single datasource.
-
- changed status to on hold
waiting for minimalistic example
- Log in to comment
Seems to be caused by the outdated OSGEO4W scikit-learn (0.23.2-1).
Works with 1.0.2 (installed via pip install scikit-learn --user), but here I run into the following (none-blocking) error message: