Note: forwarded message attached.

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

--- Begin Message ---
Authentication-Results: mta283.mail.scd.yahoo.com
  from=merck.com; domainkeys=neutral (no sig)
X-Originating-IP: [155.91.6.40]
Return-Path: <[EMAIL PROTECTED]>
Received: from 155.91.6.40  (EHLO usryim07.merck.com) (155.91.6.40)
  by mta283.mail.scd.yahoo.com with SMTP; Fri, 21 Jan 2005 03:29:25 -0800
Received: from 155.91.2.6 by usryim07.merck.com with ESMTP (SMTP Relay);
 Fri, 21 Jan 2005 06:29:17 -0500
X-Server-Uuid: D9643136-67E2-4E6E-A13C-387E6A236A69
Received: from 54.3.102.166 by usrytw32.merck.com with ESMTP (Tumbleweed
 MMS SMTP Relay (MMS v5.6.1)); Fri, 21 Jan 2005 06:29:10 -0500
X-Server-Uuid: 79464537-DA04-46B1-B103-B8820195B307
Received: by usrygw30.merck.com with Internet Mail Service (5.5.2657.72)
 id <DKTGTC4H>; Fri, 21 Jan 2005 06:29:10 -0500
From: "Liaw, Andy" <[EMAIL PROTECTED]>

        "Rpackage help" <r-help@stat.math.ethz.ch>
Subject: RE: [R] cross validation
Date: Fri, 21 Jan 2005 06:29:03 -0500
Return-Receipt-To: "Liaw, Andy" <[EMAIL PROTECTED]>
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2657.72)
X-WSS-ID: 6DEE380C1H05785560-01-01
X-WSS-ID: 6DEE380719C62869-01-01
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Content-Length: 884

One way is to create an indicator vector that indicate which `fold' a case
should belong to.  Something like:

fold <- 10
idx <- sample(fold, n, replace=TRUE)
for (I in 1:fold) {
   train.dat <- dat[idx != i,]
   test.dat <- dat[idx == i,]
   ...
}

Also see the errorest() function in the ipred package.  It is more careful
in making sure the folds are as close in size as possible, and can do
stratified splits.

Andy


> From: kolluru ramesh
> 
> How to select training data set and test data set from the 
> original data for performing cross-validation
> 
>               
> ---------------------------------
> 
> 
>       [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 


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

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

--- End Message ---
______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to