[scikit-learn] Get parameters of classes in a Pipeline within cross_validate

Chris Aridas chris at aridas.eu
Sun Apr 1 19:47:21 EDT 2018


 Hi Roberto,

One option it could be to make a wrapper and serialize your pipeline in
your wrapper's fit method.
After the serialization you could load the pipeline anytime and inspect
whatever you want.
I have coded an example in the following gist.

https://gist.github.com/chkoar/2993a6e3f6bae1887eabc3fa27bb06a6

Best,
Chris


On Thu, Mar 29, 2018 at 12:16 PM, Roberto Guidotti <robbenson18 at gmail.com>
wrote:

> Hi scikit-learners,
>
> I have a simple Pipeline with Feature Selection and SVC classifier and I
> use it in a cross validation schema with cross_validate /
> cross_validation_score functions.
> I need to extract the selected features for each fold of the CV and in
> general get information about the fitted elements of the pipeline in each
> of the CV fold.
>
> Is there a way to get these information (e.g. fs.get_support() or
> fs.scores_) or I need to build my own cross_validate function?
>
> Thank you,
> Roberto
>
> --
> Ing. Roberto Guidotti, PhD.
> PostDoc Fellow
> Institute for Advanced Biomedical Technologies - ITAB
> Department of Neuroscience and Imaging
> University of Chieti "G. D'Annunzio"
> Via dei Vestini, 33
> 66013 Chieti, Italy
> tel: +39 0871 3556919
> e-mail: r.guidotti at unich.it; rguidotti at acm.org
> linkedin: http://it.linkedin.com/in/robertogui/
> twitter: @robbisg
> github: https://github.com/robbisg
>
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20180402/3c3d7ef5/attachment.html>


More information about the scikit-learn mailing list