MLearn-methods         package:MLInterfaces         R Documentation

_M_e_t_h_o_d_s _f_o_r _F_u_n_c_t_i_o_n _M_L_e_a_r_n _i_n _P_a_c_k_a_g_e '_M_L_I_n_t_e_r_f_a_c_e_s'

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

     test version of more lightweight interface

_M_e_t_h_o_d_s:

          The parameters of the generic are 'formula', 'data',
          'method', and 'trainInds'.

          The fundamental method employs a formula and a data.frame
          instance and applies a machine learning algorithm identified
          by 'method', specifying the training set indices for the
          training run.  An instance of 'MLOutput-class' is returned.

          'MLearn' is an evolving interface.  To determine what  values
          for 'method' are currently supported, issue the command
          'tellMLearnMethods()'.  This looks at the 'MLearn' code in
          real time and describes branch points in a switch statement.

          An adaptation allows an 'ExpressionSet' instance to be bound
          to the 'data' parameter.  The ExpressionSet and phenoData
          will be converted to a data.frame instance using the internal
          'es2df' function, and this can be large.  Typically the genes
          will be filtered before applying this procedure.

          For this interface, one can obtain the training data
          confusion matrix using 'confuMatTrain'.  A slot
          'predLabelsTr' is populated for this purpose, and an
          extractor method exists.

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

     tellMLearnMethods()
     library(MASS)
     data(Pima.tr)
     pm = MLearn(type~., data=Pima.tr, "lda", 1:150 )
     confuMatTrain(pm)  # on training data
     confuMat(pm)  # on held-out test data
     #
     pm2 = MLearn(type~., data=Pima.tr, "logistic", 1:150, mlSpecials=
       list(thresh=.2) )
     confuMat(pm2)
     #
     library(golubEsets)
     data(Golub_Merge)
     rp = MLearn(ALL.AML~., Golub_Merge[1:200,], "rpart", 1:35 )
     confuMat(rp)
     sv = MLearn(ALL.AML~., Golub_Merge[1:200,], "svm", 1:35 )
     confuMat(sv)
     confuMatTrain(sv)
     # illustrate real adaboost
     rab = MLearn(ALL.AML~., Golub_Merge[1:200,], "RAB", 1:35, 
        maxiter=20, maxdepth=2)
     confuMatTrain(rab)
     confuMat(rab)
     # illustrate regularized discriminant analysis
     rda = MLearn(ALL.AML~., Golub_Merge[1:2000,], "rdacv", 1:35 )
     confuMatTrain(rda)
     confuMat(rda)

