AttributeError: 'VotingClassifier' object has no attribute 'estimators_' #7382
EDIT: Never mind, saw that I need to call fit on it and not just pass in already fitted models, which is how I wanted to used it. Apologies.
Looking at the voting_classifier.py
class VotingClassifier(BaseEstimator, ClassifierMixin, TransformerMixin):
So it looks like the initialization of self.estimators should be self.estimators_
from collections import OrderedDict
from sklearn.cross_validation import StratifiedShuffleSplit
from scipy.stats.stats import pearsonr
from DataStream import *
def training2(X, y, test_X = None, test_y = None):
Traceback (most recent call last):
import sys; print("Python", sys.version)
The text was updated successfully, but these errors were encountered:
hm it looks like currently we currently don't support "prefit" estimators. That's a bit surprising to me.
I think the easy solution would be to add a
Another option would be to check in
Hey together, as it appears that there is a conclusion in #8370, would it be possible to add the feature of passing already fitted estimators to the VotingClassifier and VotingRegressor? If yes, @franchuterivera could jump on this feature if there is a concrete way how to implement this.
In case anyone already needs this feature in the meantime, one can apply the following hack which appears to work as long as one restricts to