<div dir="ltr"><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><span style="color:rgb(85,85,85);font-family:sans-serif;border-width:2px 0px 0px;border-style:solid;border-color:rgb(213,15,37);padding-top:2px;margin-top:2px"><br></span><span style="color:rgb(85,85,85);font-family:sans-serif;border-width:2px 0px 0px;border-style:solid;border-color:rgb(213,15,37);padding-top:2px;margin-top:2px">Sayak Paul |</span><span style="color:rgb(85,85,85);font-family:sans-serif;border-width:2px 0px 0px;border-style:solid;border-color:rgb(51,105,232);padding-top:2px;margin-top:2px"> <a href="http://sayak.dev" target="_blank">sayak.dev</a></span><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <span dir="auto"><<a href="mailto:scikit-learn-request@python.org">scikit-learn-request@python.org</a>></span><br>Date: Fri, Sep 13, 2019 at 10:46 AM<br>Subject: scikit-learn Digest, Vol 42, Issue 15<br>To: <<a href="mailto:scikit-learn@python.org">scikit-learn@python.org</a>><br></div><br><br>Send scikit-learn mailing list submissions to<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<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>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:scikit-learn-request@python.org" target="_blank">scikit-learn-request@python.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:scikit-learn-owner@python.org" target="_blank">scikit-learn-owner@python.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of scikit-learn digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: scikit-learn Digest, Vol 42, Issue 14 (Sayak Paul)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 13 Sep 2019 10:46:09 +0530<br>
From: Sayak Paul <<a href="mailto:spsayakpaul@gmail.com" target="_blank">spsayakpaul@gmail.com</a>><br>
To: <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
Subject: Re: [scikit-learn] scikit-learn Digest, Vol 42, Issue 14<br>
Message-ID:<br>
<CAGa_XGHgifW7W81-dVv3R3e80Nz2BVx=<a href="mailto:eWiKv52oRf-BS%2BRjXw@mail.gmail.com" target="_blank">eWiKv52oRf-BS+RjXw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
I was able to solve the problem using -<br>
<br>
mlb = MultiLabelBinarizer()<br>
mlb.fit([y_train])<br>
<br>
Thanks for the suggestions. The output of mlb.classes_ now looks the<br>
following (first ten classes):<br>
[image: image.png]<br>
<br>
However, when I transform it using mlb.transform([y_train]), another<br>
problem arrises -<br>
<br>
[image: image.png]<br>
<br>
Kindly suggest :)<br>
<br>
<br>
Sayak Paul | <a href="http://sayak.dev" rel="noreferrer" target="_blank">sayak.dev</a><br>
<br>
<br>
On Thu, Sep 12, 2019 at 9:33 PM <<a href="mailto:scikit-learn-request@python.org" target="_blank">scikit-learn-request@python.org</a>> wrote:<br>
<br>
> Send scikit-learn mailing list submissions to<br>
> <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
><br>
> To subscribe or unsubscribe via the World Wide Web, visit<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>
> or, via email, send a message with subject or body 'help' to<br>
> <a href="mailto:scikit-learn-request@python.org" target="_blank">scikit-learn-request@python.org</a><br>
><br>
> You can reach the person managing the list at<br>
> <a href="mailto:scikit-learn-owner@python.org" target="_blank">scikit-learn-owner@python.org</a><br>
><br>
> When replying, please edit your Subject line so it is more specific<br>
> than "Re: Contents of scikit-learn digest..."<br>
><br>
><br>
> Today's Topics:<br>
><br>
> 1. Re: MultiLabelBinarizer gives individual characters instead<br>
> of the classes (Lo?c Est?ve)<br>
> 2. Re: Vote on SLEP009: keyword only arguments (Guillaume Lema?tre)<br>
> 3. How can I enable line tracing for cython modules.<br>
> (Alejandro Javier Peralta Frias)<br>
><br>
><br>
> ----------------------------------------------------------------------<br>
><br>
> Message: 1<br>
> Date: Thu, 12 Sep 2019 07:24:48 +0200<br>
> From: Lo?c Est?ve <<a href="mailto:loic.esteve@ymail.com" target="_blank">loic.esteve@ymail.com</a>><br>
> To: Scikit-learn mailing list <<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>><br>
> Subject: Re: [scikit-learn] MultiLabelBinarizer gives individual<br>
> characters instead of the classes<br>
> Message-ID: <<a href="mailto:vnokwoeeozmn.fsf@ymail.com" target="_blank">vnokwoeeozmn.fsf@ymail.com</a>><br>
> Content-Type: text/plain; charset=utf-8<br>
><br>
> I think this caveat has been added in the dev doc (not yet in the stable<br>
> doc). You may want to read:<br>
><br>
> <a href="https://scikit-learn.org/dev/modules/generated/sklearn.preprocessing.MultiLabelBinarizer.html" rel="noreferrer" target="_blank">https://scikit-learn.org/dev/modules/generated/sklearn.preprocessing.MultiLabelBinarizer.html</a><br>
> and in particular the part that starts with "A common mistake is to pass<br>
> in a list".<br>
><br>
> Cheers,<br>
> Lo?c<br>
><br>
> > Hi.<br>
> ><br>
> > I am working on a Multi-label text classification problem. In order to<br>
> encode the labels, I am using MultiLabelBinarizer. The labels of the<br>
> dataset look like -<br>
> ><br>
> > image<br>
> ><br>
> > When I am using<br>
> ><br>
> > mlb = MultiLabelBinarizer()<br>
> > mlb.fit(labels)<br>
> > print(mlb.classes_)<br>
> ><br>
> > I am getting -<br>
> ><br>
> > image<br>
> ><br>
> > Whereas, the output (sample output) I want is -<br>
> ><br>
> > image<br>
> ><br>
> > I got the above output by -<br>
> ><br>
> > mlb = MultiLabelBinarizer()<br>
> > sample_labels = [<br>
> > ['stat.ML', 'cs.LG'],<br>
> > ['cs.CV', 'cs.RO']<br>
> > ]<br>
> > mlb.fit(sample_labels)<br>
> > print(mlb.classes_)<br>
> ><br>
> > Help would be very much appreciated here.<br>
> ><br>
> > Here's the dataset I had prepared:<br>
> > arXivdata.csv.zip<br>
> ><br>
> > I stripped away the double quotes in the labels after loading it in a<br>
> pandas DataFrame by -<br>
> ><br>
> > import re<br>
> ><br>
> > arxiv_data['labels'] = arxiv_data['labels'].str.replace(r"[\"]", '')<br>
> ><br>
> > scikit-learn version: '0.21.3'<br>
> ><br>
> > Sayak Paul | <a href="http://sayak.dev" rel="noreferrer" target="_blank">sayak.dev</a><br>
><br>
><br>
><br>
> ------------------------------<br>
><br>
> Message: 2<br>
> Date: Thu, 12 Sep 2019 10:06:30 +0200<br>
> From: Guillaume Lema?tre <<a href="mailto:g.lemaitre58@gmail.com" target="_blank">g.lemaitre58@gmail.com</a>><br>
> To: Scikit-learn mailing list <<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>><br>
> Subject: Re: [scikit-learn] Vote on SLEP009: keyword only arguments<br>
> Message-ID:<br>
> <<br>
> <a href="mailto:CACDxx9jCkE5GAjRNj3TKinbuyWZQvXMrrcHBBqn6q_FXYdPrbQ@mail.gmail.com" target="_blank">CACDxx9jCkE5GAjRNj3TKinbuyWZQvXMrrcHBBqn6q_FXYdPrbQ@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
><br>
> To the question: do we want to utilise Python 3's force-keyword-argument<br>
> syntax<br>
> and to change existing APIs which support arguments positionally to use<br>
> this<br>
> syntax, via a deprecation period?<br>
><br>
> I am +1.<br>
><br>
> IMO, even if the syntax might be unknown, it will remain unknown until<br>
> projects<br>
> from the ecosystem are not using it.<br>
><br>
> To the question: which methods should be impacted?<br>
><br>
> I think we should be as gentle as possible at first. I am a little<br>
> concerned about<br>
> breaking some codes which were working fine before.<br>
><br>
> On Thu, 12 Sep 2019 at 04:43, Joel Nothman <<a href="mailto:joel.nothman@gmail.com" target="_blank">joel.nothman@gmail.com</a>> wrote:<br>
><br>
> > These there details of specific API changes to be decided:<br>
> ><br>
> > The question being put, as per the SLEP, is:<br>
> > do we want to utilise Python 3's force-keyword-argument syntax<br>
> > and to change existing APIs which support arguments positionally to use<br>
> > this syntax, via a deprecation period?<br>
> > _______________________________________________<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>
> ><br>
><br>
><br>
> --<br>
> Guillaume Lemaitre<br>
> INRIA Saclay - Parietal team<br>
> Center for Data Science Paris-Saclay<br>
> <a href="https://glemaitre.github.io/" rel="noreferrer" target="_blank">https://glemaitre.github.io/</a><br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<br>
> <a href="http://mail.python.org/pipermail/scikit-learn/attachments/20190912/047eb83c/attachment-0001.html" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20190912/047eb83c/attachment-0001.html</a><br>
> ><br>
><br>
> ------------------------------<br>
><br>
> Message: 3<br>
> Date: Thu, 12 Sep 2019 09:23:03 -0300<br>
> From: Alejandro Javier Peralta Frias<br>
> <<a href="mailto:alejandro.peralta@mercadolibre.com" target="_blank">alejandro.peralta@mercadolibre.com</a>><br>
> To: <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
> Subject: [scikit-learn] How can I enable line tracing for cython<br>
> modules.<br>
> Message-ID:<br>
> <CAL+ZpG6ccwnnJm1Q2CQM4qt+sfiMtHV5Tr=<br>
> <a href="mailto:mgsgFpcmASzUhZA@mail.gmail.com" target="_blank">mgsgFpcmASzUhZA@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
><br>
> Hello all,<br>
><br>
> To enable cython tracing (in particular I want to line trace neighbors<br>
> module) I understand that I have to recompile the cython modules with<br>
> CYTHON_TRACE=1 but I'm not sure where should I set this.<br>
><br>
> Should I use:<br>
><br>
> # distutils: define_macros=CYTHON_TRACE_NOGIL=1<br>
><br>
><br>
> In the files I want to trace?<br>
><br>
> Regards,<br>
> --<br>
> Ale<br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<br>
> <a href="http://mail.python.org/pipermail/scikit-learn/attachments/20190912/0377329b/attachment-0001.html" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20190912/0377329b/attachment-0001.html</a><br>
> ><br>
><br>
> ------------------------------<br>
><br>
> Subject: Digest Footer<br>
><br>
> _______________________________________________<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>
><br>
><br>
> ------------------------------<br>
><br>
> End of scikit-learn Digest, Vol 42, Issue 14<br>
> ********************************************<br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.python.org/pipermail/scikit-learn/attachments/20190913/921c80cd/attachment.html" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20190913/921c80cd/attachment.html</a>><br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: image.png<br>
Type: image/png<br>
Size: 16117 bytes<br>
Desc: not available<br>
URL: <<a href="http://mail.python.org/pipermail/scikit-learn/attachments/20190913/921c80cd/attachment.png" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20190913/921c80cd/attachment.png</a>><br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: image.png<br>
Type: image/png<br>
Size: 7675 bytes<br>
Desc: not available<br>
URL: <<a href="http://mail.python.org/pipermail/scikit-learn/attachments/20190913/921c80cd/attachment-0001.png" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/scikit-learn/attachments/20190913/921c80cd/attachment-0001.png</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<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>
<br>
<br>
------------------------------<br>
<br>
End of scikit-learn Digest, Vol 42, Issue 15<br>
********************************************<br>
</div></div>