Please, why is estimators function in Ensemble learning not working in python 3?
StackingClassifier(estimators=base_learners, final_estimator=LogisticRegression())
TypeError: __init__() got an unexpected keyword argument 'estimators'
That is the error.
Thanks in advance.
Since you are receiving a TypeError, you are probably passing incorrect data type to the function. Assuming that you are using sklearn.ensemble.StackingClassifier ( docs ), it requires a list of (str, estimator) tuples.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.