Hi Alexandre,

My problem was that each sample was obtained from a specific subject (a
same subject possibly produced several samples) and I wanted to train and
test on different subjects.

As I understand it, LeaveOneLabelOut (and more generally LeavePLabelOut)
can be used to leaves one subject (or K subjects) out.
However it does not maintain a balance in the folds. (For instance, if we
use a LeaveOneLabelOut, we could have a testing set with only one sample
and another one with 100 if one subject appear only in 1 sample and another
in 100 samples).

Here I wanted to keep the folds approximately balanced while making sure
that a same subject was not used for both training and testing.

Cheers,

Jean

2015-03-24 15:58 GMT+00:00 Alexandre Gramfort <
alexandre.gramf...@telecom-paristech.fr>:

> hi jean,
>
> how different is it from
>
> http://scikit-learn.org/stable/modules/generated/sklearn.cross_validation.LeaveOneLabelOut.html
> ?
>
> A
>
> On Tue, Mar 24, 2015 at 4:49 PM, Jean K <jean.kossa...@gmail.com> wrote:
> > Hi all,
> >
> > I recently needed to perform some subject independent KFold
> > cross-validation. To my knowledge this feature isn't in the scikit-learn
> > yet, so I created a pull-request with a simple implementation.
> >
> > It is similar the original Fold except that it takes as parameter an
> array
> > of subjects (similarly to the StratifiedKFold that takes an array of
> labels
> > as a parameter) and separate these into K Folds, approximately
> equilibrated,
> > where each subject appears only in one fold.
> >
> > Do you think this would be useful?
> >
> > Cheers,
> >
> > Jean
> >
> >
> ------------------------------------------------------------------------------
> > Dive into the World of Parallel Programming The Go Parallel Website,
> > sponsored
> > by Intel and developed in partnership with Slashdot Media, is your hub
> for
> > all
> > things parallel software development, from weekly thought leadership
> blogs
> > to
> > news, videos, case studies, tutorials and more. Take a look and join the
> > conversation now. http://goparallel.sourceforge.net/
> > _______________________________________________
> > Scikit-learn-general mailing list
> > Scikit-learn-general@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
> >
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs
> to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to