[BUG] AttributeError in RotationForest when using base_estimator parameter · Issue #8265 · sktime/sktime · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
File "/.../sktime/classification/sklearn/_rotation_forest.py", line 436, in _fit_estimator
tree = _clone_estimator(self._base_estimator, random_state=rs)
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'RotationForest' object has no attribute '_base_estimator'. Did you mean: 'base_estimator'?
Expected behavior
Correctly fitting the classifier.
Additional context
Looking at the source code of RotationForest, in __init__ the parameter is correctly captured:
...
self.base_estimator=base_estimator
But in the code of fit() one can see this code fragment:
This correctly instantiates the internal _base_estimator for the case of the default parameter. But in the case a custom estimator was passed at instantiation, it seem that internal is not created. And then when calling _clone_estimator the exception in the error message above is thrown.
Describe the bug
In
RotationForest
, using the parameterbase_estimator
causesAttributeError
when callingfit()
.To Reproduce
Here is a minimal example
This produces:
Expected behavior
Correctly fitting the classifier.
Additional context
Looking at the source code of
RotationForest
, in__init__
the parameter is correctly captured:But in the code of
fit()
one can see this code fragment:This correctly instantiates the internal
_base_estimator
for the case of the default parameter. But in the case a custom estimator was passed at instantiation, it seem that internal is not created. And then when calling_clone_estimator
the exception in the error message above is thrown.Versions
The text was updated successfully, but these errors were encountered: