<div dir="ltr">Hi Manuel,<div>thanks for your reply, before trying an alternative as PipeGraph, or implementing the class as you propose, I would prefer to include some code in the _fit method of BaggingClassifier, so the correct value of X can be passed to the base_estimator (the dataframe or its array of values).</div><div>Many thanks in advance,</div><div>Roxna</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 28, 2019 at 2:39 PM Manuel CASTEJÓN LIMAS via scikit-learn <<a href="mailto:scikit-learn@python.org">scikit-learn@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">You can always add a first step that turns you numpy array into a DataFrame such as the one required afterwards.<div dir="auto">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.</div><div dir="auto">Alternatively you can try the PipeGraph library for dealing with those complex routes.<br><div dir="auto">Best</div><div dir="auto">Manuel</div><div dir="auto">Disclaimer: yes, I'm a coauthour of the PipeGraph library.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El vie., 28 jun. 2019 7:28, Roxana Danger <<a href="mailto:roxana.danger@gmail.com" target="_blank">roxana.danger@gmail.com</a>> escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<div>I would like to use the BaggingClassifier whose base estimator is a pipeline with multiple transformations including a DataFrameMapper from sklearn_pandas.</div><div>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 <span style="color:rgb(0,0,0);font-family:Menlo;font-size:9pt">BaseBagging._fit method</span>). 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.</div><div><br></div><div>Is there anyway I can overcome this problem?</div><div><br></div><div>Many thanks,</div><div>Roxana</div><div><br></div></div>
_______________________________________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" rel="noreferrer" target="_blank">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn</a><br>
</blockquote></div>
_______________________________________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn</a><br>
</blockquote></div>