[scikit-learn] Combine already fitted models

Rares Vernica rvernica at gmail.com
Sun Oct 1 19:22:55 EDT 2017


> > I am looking at VotingClassifier but it seems that it is expected that
the estimators are fitted when VotingClassifier.fit() is called. I don't
see how I can have already fitted classifiers combined under a
VotingClassifier.
>
> I think the opposite is true: The classifiers provided via an
`estimators` argument upon initialization will be cloned and fitted if you
call VotingClassifier's  fit(). Based on your follow-up question, I think
you meant "it is expected that the estimators are *not* fitted when
VotingClassifier.fit() is called," right?!

Yes, you are right. Sorry for the confusion. Thanks for the pointer!

I am also exploring something like:

vc = VotingClassifier(...)
vc.estimators_ = [e1, e2, ...]
vc.le_ = ...
vc.predict(...)

But I am not sure it is recommended to modify the "private" estimators_ and
le_ attributes.

--
Rares
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20171001/c6243dd4/attachment.html>


More information about the scikit-learn mailing list