[R] randomness in stepclass (klaR) or lda (MASS) ?

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu Apr 29 16:18:23 CEST 2010



On 29.04.2010 16:04, Eric Elguero wrote:
> On Thu, 2010-04-29 at 15:08 +0200, Uwe Ligges wrote:
>
>> Well, it is called cross validation which is based on random sampling if
>> you do not have k=n -fold CV (=leave-one-out).
>> Again, to get reproducible results, you will need to set a seed.
>>
>
> thank you. I thought that "leave-one-out" was the default.


As you can see in ?stepclass:

fold 	parameter for cross-validation; omitted if ‘cv.groups’ is specified.

and the "Usage" line tells us:

..... fold = 10, ......

hence 10-fold is the default.



> I looked at the reference file and I am not sure how to get it.
>
> Is that by setting fold=1 ?


No, leave one out is n-fold, hence you need n!

Uwe Ligges



>>
>> If the results are that unstable: Do you really have a sufficient number
>> of observations for your classification problem?
>
> you're probably right.
>
> e.e.
>
>
> Eric Elguero
> Laboratory Genetics and Evolution of Infectious Diseases,
> Team: Genetics and Adaptation of Plasmodium
> UMR 2724 CNRS-IRD,
> IRD Montpellier,
> 911 Avenue Agropolis, BP 64501,
> 34394 Montpellier Cedex 5,
> France
>
>



More information about the R-help mailing list