pamr.predict              package:pamr              R Documentation

_A _f_u_n_c_t_i_o_n _g_i_v_i_n_g _p_r_e_d_i_c_t_i_o_n _i_n_f_o_r_m_a_t_i_o_n,
_f_r_o_m _a _n_e_a_r_e_s_t _s_h_r_u_n_k_e_n _c_e_n_t_r_o_i_d _f_i_t.

_D_e_s_c_r_i_p_t_i_o_n:

     A function giving prediction information, from a nearest shrunken
     centroid fit

_U_s_a_g_e:

     pamr.predict(fit, newx, threshold, type= c("class", "posterior", "centroid", "nonzero"), prior = fit$prior, threshold.scale = fit$threshold.scale)

_A_r_g_u_m_e_n_t_s:

     fit: The result of a call to pamr.train 

    newx: Matrix of features at which predictions are to be made

threshold: The desired threshold value

    type: Type of prediction desired: class predictions, posterior
          probabilities, (unshrunken) class centroids, vector of  genes
          surviving the threshold

   prior: Prior probabilities for each class. Default is that specified
          in "fit"

threshold.scale: Additional scaling factors to be applied to the
          thresholds. Vector of length equal to the number of classes.
          Default is that specified in "fit".

_D_e_t_a_i_l_s:

     'pamr.predict' Give a cross-tabulation of true versus predicted
     classes for the fit returned by pamr.train or pamr.cv, at the
     specified threshold

_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=y)
     mytrain <-   pamr.train(mydata)
     mycv <- pamr.cv(mytrain,mydata)
     pamr.predict(mytrain, mydata$x , threshold=1)
      

