[scikit-learn] baggingClassifier with pipeline

Manuel CASTEJÓN LIMAS mcasl at unileon.es
Fri Jun 28 09:36:22 EDT 2019


You can always add a first step that turns you numpy array into a DataFrame
such as the one required afterwards.
A bit of object oriented programming might be required though, for deriving
you class from BaseTransformer and writing you particular code for fit and
transform method.
Alternatively you can try the PipeGraph library for dealing with those
complex routes.
Best
Manuel
Disclaimer: yes, I'm a coauthour of the PipeGraph library.

El vie., 28 jun. 2019 7:28, Roxana Danger <roxana.danger at gmail.com>
escribió:

> Hello,
> I would like to use the BaggingClassifier whose base estimator is a
> pipeline with multiple transformations including a DataFrameMapper from
> sklearn_pandas.
> I am getting an error during the fitting the DataFrameMapper as the first
> step of the BaggingClassifier is to convert the DataFrame to an array (see
> in BaseBagging._fit method). Similar problem happen using directly
> sklearn.Pipeline instead of the DataFrameMapper. in both cases, a DataFrame
> is expected as input, but, instead, an array is provided to the Pipeline.
>
> Is there anyway I can overcome this problem?
>
> Many thanks,
> Roxana
>
> _______________________________________________
> 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/20190628/f98b5b95/attachment-0001.html>


More information about the scikit-learn mailing list