pamr.cv                 package:pamr                 R Documentation

_A _f_u_n_c_t_i_o_n _t_o _c_r_o_s_s-_v_a_l_i_d_a_t_e _t_h_e _n_e_a_r_e_s_t _s_h_r_u_n_k_e_n _c_e_n_t_r_o_i_d
_c_l_a_s_s_i_f_i_e_r

_D_e_s_c_r_i_p_t_i_o_n:

     A function to cross-validate the nearest shrunken centroid
     classifier produced by pamr.train

_U_s_a_g_e:

     pamr.cv(fit, data,  nfold = NULL, folds = NULL,...)

_A_r_g_u_m_e_n_t_s:

     fit: The result of a call to pamr.train

    data: A list with at least two components: x- an expression genes
          in the rows, samples in the columns), and y-  a vector of the
          class labels for each sample. Same form as data object used
          by pamr.train.

   nfold: Number of cross-validation folds. Default is the smallest
          class size

   folds: A list with nfold components, each component a vector of
          indices of the samples in that fold. By default a (random)
          balanced cross-validation is used

     ...: 

     {Any additional arguments that are to be passed to pamr.train}

_D_e_t_a_i_l_s:

     'pamr.cv' carries out cross-validation for a nearest shrunken
     centroid classifier.

_V_a_l_u_e:

     A list with components 

threshold: 

  errors: The number of cross-validation  errors for each threshold
          value

  loglik: The cross-validated multinomial log-likelihood value for each
          threshold value

    size: A vector of the number of genes that survived the
          thresholding, for each threshold value tried.

    yhat: A matrix of size n by nthreshold, containing the
          cross-validated class predictions for each threshold value, 
          in each column

    prob: A matrix of size n by nthreshold, containing the
          cross-validated class probabilities for each threshold value,
           in each column

   folds: The cross-validation folds used

cv.objects: Train objects (output of pamr.train),  from each of the CV
          folds

    call: The calling sequence used

_A_u_t_h_o_r(_s):

     Trevor Hastie,Robert Tibshirani, Balasubramanian Narasimhan, and
     Gilbert Chu

_R_e_f_e_r_e_n_c_e_s:

_E_x_a_m_p_l_e_s:

     set.seed(120)
     x <- matrix(rnorm(1000*20),ncol=20)
     y <- sample(c(1:4),size=20,replace=TRUE)

     mydata <- list(x=x,y=factor(y), geneid=as.character(1:nrow(x)), genenames=paste("g",as.character(1:nrow(x)),sep=""),)

     mytrain <-   pamr.train(mydata)
     mycv <- pamr.cv(mytrain,mydata)

