koplsCrossValSet            package:kopls            R Documentation

_G_e_n_e_r_a_t_e _t_r_a_i_n_i_n_g/_t_e_s_t _o_b_s_e_r_v_a_t_i_o_n_s _f_o_r _c_r_o_s_s-_v_a_l_i_d_a_t_i_o_n

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

     Generates sets of training/test observations useful for
     cross-validation (CV). How the sets are generated is determined by
     the 'type' parameter, which can be either 'nfold' for n-fold
     cross-validation, 'mccv' for Monte Carlo CV, 'mccvb' for Monte
     Carlo class-balanced CV.

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

     koplsCrossValSet(K, Y, type = "nfold", nfold, i, trainFrac = (2/3))

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

       K: Kernel matrix.

       Y: Response matrix.

    type: Type of cross-validation: 'nfold' for n-fold, 'mccv' for
          Monte Carlo CV, 'mccvb' for  Monte Carlo class-balanced CV. 

   nfold: Number of total nfold rounds (if type='nfold').

       i: Current nfold round (if type='nfold').

trainFrac: Fraction of observations in training set.

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

     If 'type' is set to 'nfold', the parameter 'nfold' determines the
     number of rounds, which are later subindexed by the 'i' parameter.
     If 'mccv' or 'mccvb', the 'trainFrac' parameter determines the
     fraction of observations that will belong to the training set;
     remaining observations end up in the test set.

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

     List object with the following entries: 

   KTrTr: Kernel training matrix; KTrTr = <phi(Xtr),phi(Xtr)>. 

   KTeTr: Kernel test/training matrix; KTeTr = <phi(Xte),phi(Xtr)>.

   KTeTe: Kernel test matrix; KTeTe = <phi(Xte),phi(Xte)>.

  yTrain: Y training set.

   yTest: Y test set.

trainInd: Indices of training set observations.

 testInd: Indices of test set observations.

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

     Max Bylesjo and Mattias Rantalainen

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

     Rantalainen M, Bylesjo M, Cloarec O, Nicholson JK, Holmes E and
     Trygg J. *Kernel-based orthogonal projections to latent structures
     (K-OPLS)*, _J Chemometrics_ 2007; 21:376-385.
     doi:10.1002/cem.1071.

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

