-
-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
Description
Describe the bug
An error is raised when I was trying to use MultiOutputRegressor along with StackingRegressor.
ValueError Traceback (most recent call last)
<ipython-input-43-e4eb1ec64c28> in <module>
----> 1 reg.predict(X_train_norm)
~\Anaconda3\lib\site-packages\sklearn\multioutput.py in predict(self, X)
188 check_is_fitted(self)
189 if not hasattr(self.estimator, "predict"):
--> 190 raise ValueError("The base estimator should implement"
191 " a predict method")
192
ValueError: The base estimator should implement a predict method
-->
Steps/Code to Reproduce
Example:
reg=MultiOutputRegressor(StackingRegressor
(estimators=estimators,final_estimator=ExtraTreesRegressor(n_estimators=100)))
reg.fit(X_train_norm, y_train)
reg.predict(X_train_norm)
Expected Results
The expected result should be an array of predicted values.
Actual Results
raise ValueError("The base estimator should implement"
191 " a predict method")
Versions
For scikit-learn >= 0.22.1