normalize             package:sparseLDA             R Documentation

_N_o_r_m_a_l_i_z_e _t_r_a_i_n_i_n_g _d_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

     Normalize a vector or matrix to zero mean and unit length columns

_U_s_a_g_e:

     normalize(X)

_A_r_g_u_m_e_n_t_s:

       X: a matrix with the training data with observations down the
          rows and variables in the columns.

_D_e_t_a_i_l_s:

     The function can e.g. be used for the training data in sda or
     smda.

_V_a_l_u_e:

     Returns a list with the following attributes: 

      Xc: The normalized data. 

      mx: Mean of columns of X. 

      vx: Length of columns of X.  

      Id: Logical vector indicating which variables are included in X. 
          If some of the columns have zero length they are omitted.

_A_u_t_h_o_r(_s):

     Line Clemmensen

_R_e_f_e_r_e_n_c_e_s:

     Clemmensen, L., Hastie, T. and Ersboell, K. (2008) "Sparse
     discriminant analysis", Technical report, IMM, Technical
     University of Denmark

_S_e_e _A_l_s_o:

     'normalizetest', 'sda', 'smda'

_E_x_a_m_p_l_e_s:

     ## Data
     X<-matrix(sample(seq(3),12,replace=TRUE),nrow=3)

     ## Normalize data
     Nm<-normalize(X)
     print(Nm$Xc)

     ## See if any variables have been removed
     which(!Nm$Id)

