[scikit-learn] Fwd: StackingClassifier

Guillaume Lemaître g.lemaitre58 at gmail.com
Tue May 5 08:40:28 EDT 2020


Your analysis is correct:
https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/ensemble/_stacking.py#L59

It will be the prediction of each learner in the order in the list given
and finally the features which are pass-through.

It would nice when we will be able to propagate feature names :)

On Tue, 5 May 2020 at 14:31, Andrew Howe <ahowe42 at gmail.com> wrote:

> Hi All - gentle nudge in case anybody has an idea about this.
>
> Andrew
>
> <~~~~~~~~~~~~~~~~~~~~~~~~~~~>
> J. Andrew Howe, PhD
> LinkedIn Profile <http://www.linkedin.com/in/ahowe42>
> ResearchGate Profile <http://www.researchgate.net/profile/John_Howe12/>
> Open Researcher and Contributor ID (ORCID)
> <http://orcid.org/0000-0002-3553-1990>
> Github Profile <http://github.com/ahowe42>
> Personal Website <http://www.andrewhowe.com>
> I live to learn, so I can learn to live. - me
> <~~~~~~~~~~~~~~~~~~~~~~~~~~~>
>
>
> ---------- Forwarded message ---------
> From: Andrew Howe <ahowe42 at gmail.com>
> Date: Thu, Apr 30, 2020 at 6:05 PM
> Subject: StackingClassifier
> To: Scikit-learn user and developer mailing list <scikit-learn at python.org>
>
>
> Hi All
>
> Quick question about the stacking classifier
> <https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.StackingClassifier.html>.
> How do I know the order of the features that the final estimator uses? I've
> got an example which I've created like this (the LGRG and KSVM objects were
> previously defined, but as they seem they would be):
>
> passThrough = True
> finalEstim = DecisionTreeClassifier(random_state=42)
> stkClas = StackingClassifier(estimators=[('Logistic Regression', LGRG),
> ('Kernel SVM', KSVM)],
>                              cv=crossValInput, passthrough=passThrough,
> final_estimator=finalEstim,
>                              n_jobs=-1)
>
> Given this setup, I *think* the features input to the final estimator are
>
>    - Logistic regression prediction probabilities for all classes
>    - Kernel SVM prediction probabilities for all classes
>    - original features of data passed into the stacking classifier
>
> I can find no documentation on this, though, and don't know of any
> relevant attribute on the final estimator. I need this to help interpret
> the final estimator tree - and specifically to provide feature labels for
> plot_tree.
>
> Thanks!
> Andrew
>
> <~~~~~~~~~~~~~~~~~~~~~~~~~~~>
> J. Andrew Howe, PhD
> LinkedIn Profile <http://www.linkedin.com/in/ahowe42>
> ResearchGate Profile <http://www.researchgate.net/profile/John_Howe12/>
> Open Researcher and Contributor ID (ORCID)
> <http://orcid.org/0000-0002-3553-1990>
> Github Profile <http://github.com/ahowe42>
> Personal Website <http://www.andrewhowe.com>
> I live to learn, so I can learn to live. - me
> <~~~~~~~~~~~~~~~~~~~~~~~~~~~>
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>


-- 
Guillaume Lemaitre
Scikit-learn @ Inria Foundation
https://glemaitre.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20200505/95ad6782/attachment.html>


More information about the scikit-learn mailing list