tune                   package:CMA                   R Documentation

_H_y_p_e_r_p_a_r_a_m_e_t_e_r _t_u_n_i_n_g _f_o_r _c_l_a_s_s_i_f_i_e_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     Most classifiers implemented in this package depend on one or even
     several hyperparameters (s. details) that should be optimized to
     obtain good (and comparable !) results. As tuning scheme, we
     propose three fold Cross-Validation on each 'learningset' (for
     fixed selected variables). Note that 'learningsets' usually do not
     contain the complete dataset, so tuning involves a second level of
     splitting the dataset. Increasing the number of folds leads to
     larger datasets (and possibly to higher accuracy), but also to
     higher computing times.

     For S4 method information, s. 'link{tune-methods}'

_U_s_a_g_e:

     tune(X, y, f, learningsets, genesel, genesellist = list(), nbgene, classifier, fold = 3, strat = FALSE, grids = list(), trace = TRUE, ...)

_A_r_g_u_m_e_n_t_s:

       X: Gene expression data. Can be one of the following:

             *  A 'matrix'. Rows correspond to observations, columns to
                variables.

             *  A 'data.frame', when 'f' is _not_ missing (s. below).

             *  An object of class 'ExpressionSet'.

       y: Class labels. Can be one of the following:

             *  A 'numeric' vector.

             *  A 'factor'.

             *  A 'character' if 'X' is an 'ExpressionSet' that
                specifies the phenotype variable.

             *  'missing', if 'X' is a 'data.frame' and a proper
                formula 'f' is provided.

       f: A two-sided formula, if 'X' is a 'data.frame'. The left part
          correspond to class labels, the right to variables.

learningsets: An object of class 'learningsets'. May be missing, then
          the complete datasets is used as learning set.

 genesel: Optional (but usually recommended) object of class 'genesel'
          containing variable importance information for the argument
          'learningsets'

genesellist: In the case that the argument 'genesel' is missing, this
          is an argument list passed to 'GeneSelection'. If both
          'genesel' and 'genesellist' are missing, no variable
          selection is performed.

  nbgene: Number of best genes to be kept for classification, based on
          either 'genesel' or the call to 'GeneSelection' using
          'genesellist'. In the case that both are missing, this
          argument is not necessary. *note*:


             *  If the gene selection method has been one of '"lasso",
                "elasticnet", "boosting"', 'nbgene' will be reset to
                'min(s, nbgene)' where 's' is the number of nonzero
                coefficients.

             *  if the gene selection scheme has been '"one-vs-all",
                "pairwise"' for the multiclass case, there exist
                several rankings. The top 'nbgene' will be kept of
                _each_ of them, so the number of effective used genes
                will sometimes be much larger.

classifier: Name of function ending with 'CMA' indicating the
          classifier to be used.

    fold: The number of cross-validation folds used within each
          'learningset'. Default is 3. Increasing 'fold' will lead to
          higher computing times.

   strat: Should stratified cross-validation according to the class
          proportions in the complete dataset be  used ? Default is
          'FALSE'.

   grids: A named list. The names correspond to the arguments to be
          tuned, e.g. 'k' (the number of nearest neighbours) for
          'knnCMA', or 'cost' for 'svmCMA'. Each element is a 'numeric'
          vector defining the grid of candidate values. Of course,
          several hyperparameters can be tuned simultaneously (though
          requiring much time). By default, 'grids' is an empty list.
          In that case, a pre-defined list will be used, s. details.

   trace: Should progress be traced ? Default is 'TRUE'.

     ...: Further arguments to be passed to 'classifier', of course not
          one of the arguments to be tuned (!).

_D_e_t_a_i_l_s:

     The following default settings are used, if the arguments 'grids'
     is an empty list:

     '_g_b_m_C_M_A' 'n.trees = c(50, 100, 200, 500, 1000)'

     '_c_o_m_p_B_o_o_s_t_C_M_A' 'mstop = c(50, 100, 200, 500, 1000)'

     '_L_a_s_s_o_C_M_A' 'norm.fraction = seq(from=0.1, to=0.9, length=9)'

     '_E_l_a_s_t_i_c_N_e_t_C_M_A' 'norm.fraction = seq(from=0.1, to=0.9, length=5),
          lambda2 = 2^{-(5:1)}'

     '_p_l_r_C_M_A' 'lambda = 2^{-4:4}'

     '_p_l_s__l_d_a_C_M_A' 'comp = 1:10'

     '_p_l_s__l_r_C_M_A' 'comp = 1:10'

     '_p_l_s__r_f_C_M_A' 'comp = 1:10'

     '_r_f_C_M_A' 'mtry = ceiling(c(0.1, 0.25, 0.5, 1, 2)*sqrt(ncol(X))),
          nodesize = c(1,2,3)'

     '_k_n_n_C_M_A' 'k=1:10'

     '_p_k_n_n_C_M_A' 'k = 1:10'

     '_s_c_d_a_C_M_A' 'delta = c(0.1, 0.25, 0.5, 1, 2, 5)'

     '_p_n_n_C_M_A' 'sigma = c(2^{-2:2})',

     '_n_n_e_t_C_M_A' 'size = 1:5, decay = c(0, 2^{-(4:1)})'

     '_s_v_m_C_M_A', '_k_e_r_n_e_l = "_l_i_n_e_a_r"' 'cost = c(0.1, 1, 5, 10, 50, 100,
          500)'

     '_s_v_m_C_M_A', '_k_e_r_n_e_l = "_r_a_d_i_a_l"' 'cost = c(0.1, 1, 5, 10, 50, 100,
          500), gamma = 2^{-2:2}'

     '_s_v_m_C_M_A', '_k_e_r_n_e_l = "_p_o_l_y_n_o_m_i_a_l"' 'cost = c(0.1, 1, 5, 10, 50,
          100, 500), degree = 2:4'

_V_a_l_u_e:

     An object of class 'tuningresult'

_N_o_t_e:

     The computation time can be enormously high. Note that for each
     different 'learningset', the classifier must be trained 'fold'
     times 'number of possible different hyperparameter combinations'
     times. E.g. if the number of the learningsets is fifty, 'fold = 3'
     and two hyperparameters (each with 5 candidate values) are tuned,
     50x3x25=3750 training iterations are necessary !

_A_u_t_h_o_r(_s):

     Martin Slawski martin.slawski@campus.lmu.de

     Anne-Laure Boulesteix <URL: http://www.slcmsr.net/boulesteix>

_S_e_e _A_l_s_o:

     'tuningresult', 'GeneSelection', 'classification'

_E_x_a_m_p_l_e_s:

     ## Not run: 
     ### simple example for a one-dimensional grid, using compBoostCMA.
     ### dataset
     data(golub)
     golubY <- golub[,1]
     golubX <- as.matrix(golub[,-1])
     ### learningsets
     set.seed(111)
     lset <- GenerateLearningsets(y=golubY, method = "CV", fold=5, strat =TRUE)
     ### tuning after gene selection with the t.test
     tuneres <- tune(X = golubX, y = golubY, learningsets = lset,
                   genesellist = list(method = "t.test"),
                   classifier=compBoostCMA, nbgene = 100,
                   grids = list(mstop = c(50, 100, 250, 500, 1000)))
     ### inspect results
     show(tuneres)
     best(tuneres)
     plot(tuneres, iter = 3)
     ## End(Not run)

