[scikit-learn] Nested Leave One Subject Out (LOSO) cross validation with scikit

Ludovico Coletta ludo25_90 at hotmail.com
Wed Dec 7 15:13:28 EST 2016


Thank you for the answer.


I also thought about  ShuffleSplit (n_splits=1), but I need to control which indices are used for training and which for testing in the nested folds. The problem is that I did feature selection before hyperparameters optimization (with a nested Leave One Out schema) and now I need the same partitioning for hyperparameters optimization. The reason why I did this is that the feature selection step is incredibly slow, I hope I can get rid of that step in the permutation test. Is not clear to me if I have to include feature selection in the permutation test as well.


Maybe LeavePOut is what I need.


Best

Ludovico


________________________________
Da: scikit-learn <scikit-learn-bounces+ludo25_90=hotmail.com at python.org> per conto di scikit-learn-request at python.org <scikit-learn-request at python.org>
Inviato: mercoledì 7 dicembre 2016 17.48
A: scikit-learn at python.org
Oggetto: scikit-learn Digest, Vol 9, Issue 22

Send scikit-learn mailing list submissions to
        scikit-learn at python.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://mail.python.org/mailman/listinfo/scikit-learn
scikit-learn Info Page - Python<https://mail.python.org/mailman/listinfo/scikit-learn>
mail.python.org
To see the collection of prior postings to the list, visit the scikit-learn Archives. Using scikit-learn: To post a message to all the list members ...



or, via email, send a message with subject or body 'help' to
        scikit-learn-request at python.org

You can reach the person managing the list at
        scikit-learn-owner at python.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of scikit-learn digest..."


Today's Topics:

   1. Re: New to scikit (Andreas Mueller)
   2. Re: Nested Leave One Subject Out (LOSO) cross validation with
      scikit (Andreas Mueller)
   3. return type of StandardScaler (Nilay Shrivastava)
   4. Re: return type of StandardScaler (Bharat Didwania .)


----------------------------------------------------------------------

Message: 1
Date: Wed, 7 Dec 2016 11:33:38 -0500
From: Andreas Mueller <t3kcit at gmail.com>
To: Scikit-learn user and developer mailing list
        <scikit-learn at python.org>
Subject: Re: [scikit-learn] New to scikit
Message-ID: <f1d5d579-0646-d05d-4bde-9d44c34ec2a3 at gmail.com>
Content-Type: text/plain; charset="windows-1252"; Format="flowed"

http://scikit-learn.org/dev/developers/contributing.html#deprecation

On 12/07/2016 09:42 AM, Chinmay Talegaonkar wrote:
> Yeah, I found an easy bug. Looking for some help in writing
> deprecation cycles for a bug.
>
> On Wed, Dec 7, 2016 at 8:05 PM, Siddharth Gupta
> <siddharthgupta234 at gmail.com <mailto:siddharthgupta234 at gmail.com>> wrote:
>
>     Great! Welcome to the community. I would suggest you to check out
>     the issues page on the github repo, raise hand to the issues you
>     feel like you can give a go to, check out the issues that are
>     tagged as require contributor. Issues are a good way to start,
>     they will direct you about the areas of the code base to  explore.
>
>     On Dec 7, 2016 6:02 PM, "Chinmay Talegaonkar"
>     <chinmay0301 at gmail.com <mailto:chinmay0301 at gmail.com>> wrote:
>
>         Hi everyone,
>                             I have a prior experience in python, and
>         have started learning machine learning recently. I wanted to
>         contribute to scikit, can anyone suggest a relatively easy
>         codebase to explore.
>            Thanks in advance!
>
>
>         _______________________________________________
>         scikit-learn mailing list
>         scikit-learn at python.org <mailto:scikit-learn at python.org>
>         https://mail.python.org/mailman/listinfo/scikit-learn
>         <https://mail.python.org/mailman/listinfo/scikit-learn>
>
>
>     _______________________________________________
>     scikit-learn mailing list
>     scikit-learn at python.org <mailto:scikit-learn at python.org>
>     https://mail.python.org/mailman/listinfo/scikit-learn
>     <https://mail.python.org/mailman/listinfo/scikit-learn>
>
>
>
>
> --
> --
> *Chinmay Talegaonkar*
> Cultural and Events Coordinator, Mood Indigo
> ..............................................
>
>
> +91-8879178724
> chinmay0301 at gmail.com <mailto:bajajkshitij19 at gmail.com>
> www.moodi.org<http://www.moodi.org> <http://www.moodi.org/>
>
>
>
>
>
> _______________________________________________
> 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/20161207/4f86464e/attachment-0001.html>

------------------------------

Message: 2
Date: Wed, 7 Dec 2016 11:33:00 -0500
From: Andreas Mueller <t3kcit at gmail.com>
To: Scikit-learn user and developer mailing list
        <scikit-learn at python.org>
Subject: Re: [scikit-learn] Nested Leave One Subject Out (LOSO) cross
        validation with scikit
Message-ID: <e9e342f5-d09b-92b7-e304-a0bfa37aecb6 at gmail.com>
Content-Type: text/plain; charset="windows-1252"; Format="flowed"



On 12/07/2016 07:41 AM, Ludovico Coletta wrote:
>
> Dear scikit experts,
>
>
> I did as you suggested, but it is not exactly what I would like to do
> ( I also read this:
> http://stackoverflow.com/questions/40400351/nested-cross-validation-with-stratifiedshufflesplit-in-sklearn)
>
> Perhaps I should ask my question in another way: it is possible to
> split the nested cv folds just once? It seems to me that this is not
> possible, do you have any hints?
>
>
Not sure I understand your question.
You can do a single split by using ShuffleSplit(n_splits=1) for example.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20161207/063e6a44/attachment-0001.html>

------------------------------

Message: 3
Date: Wed, 7 Dec 2016 22:14:18 +0530
From: Nilay Shrivastava <nilay.euler16 at gmail.com>
To: scikit-learn at python.org
Subject: [scikit-learn] return type of StandardScaler
Message-ID:
        <CAKLfaQRA_qGdYPrDdtG58nhyBQurWBCT2_2NZKzRiOmww5rgJw at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

StandardScaler returns numpy array even if the object passed is a pandas
dataframe, shouldn't it return a dataframe?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20161207/feecd6be/attachment-0001.html>

------------------------------

Message: 4
Date: Wed, 7 Dec 2016 08:48:47 -0800
From: "Bharat Didwania ." <bharat.didwania.eee14 at itbhu.ac.in>
To: Scikit-learn user and developer mailing list
        <scikit-learn at python.org>
Subject: Re: [scikit-learn] return type of StandardScaler
Message-ID:
        <CAA3g_m_jqWaLgkqA530vP5pshdry+mCWqiUtS5QhDV-EjtcThQ at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

 you can use pandas.get_dummies()
<http://pandas.pydata.org/pandas-docs/stable/generated/pandas.get_dummies.html>.
It will perform one hot encoding on categorical columns, and produce a
dataframe as the result. From there you can use pandas.concat([existing_df,
new_df],axis=0) to add the new columns to your existing dataframe. This
will avoid the use of a numpy array.


On Wed, Dec 7, 2016 at 8:44 AM, Nilay Shrivastava <nilay.euler16 at gmail.com>
wrote:

> StandardScaler returns numpy array even if the object passed is a pandas
> dataframe, shouldn't it return a dataframe?
>
>
> _______________________________________________
> 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/20161207/d6afb4d5/attachment.html>

------------------------------

Subject: Digest Footer

_______________________________________________
scikit-learn mailing list
scikit-learn at python.org
https://mail.python.org/mailman/listinfo/scikit-learn


------------------------------

End of scikit-learn Digest, Vol 9, Issue 22
*******************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20161207/bd6ba502/attachment-0001.html>


More information about the scikit-learn mailing list