finalClassifier-class        package:Rmagpie        R Documentation

_f_i_n_a_l_C_l_a_s_s_i_f_i_e_r: _A _c_l_a_s_s _t_o _s_t_o_r_e _t_h_e _f_i_n_a_l _c_l_a_s_s_i_f_i_e_r _c_o_r_r_e_s_p_o_n_d_i_n_g _t_o _a_n _a_s_s_e_s_s_m_e_n_t

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

     This class stores the properties of the final classifiers
     associated to a given assessment. A classifier is usually
     available for each option value defined in the slot
     featureSelectionOptions. This final classifier is obtained by
     running the feature selction method on the whole dataset to find
     the relevant genes and then train the classifier on the whole data
     considering only the relevant genes.

_C_r_e_a_t_i_n_g _o_b_j_e_c_t_s:

     To generate the final classifier, call the method
     'findFinalClassifier' on an object of class assessment
     ('findFinalClassifier-methods').

_S_l_o_t_s:


     '_g_e_n_e_s_F_r_o_m_B_e_s_t_T_o_W_o_r_s_t': 'character'. If the feature selection
          method is RFE: the genes ordered by the weights obtained with
          the smallest subset size during RFE. If the method of
          featuure selection is the Nearest Shrunken Centroid, this
          slot is empty.

     '_m_o_d_e_l_s': 'list of object of class svm'.If the feature selection
          method is RFE: svm models trained on the whole dataset for
          each size of subset (2 attributes: 'model', the classifier
          model and 'modelFeatures' the features selected for each
          subset). If the feature selection method is NSC: the object
          created by pamr.train on the whole dataset.

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


     '_g_e_t_G_e_n_e_s_F_r_o_m_B_e_s_t_T_o_W_o_r_s_t(_f_i_n_a_l_C_l_a_s_s_i_f_i_e_r)' Retreive the genes
          ordered by their weights obtained with the smallest subset
          during RFE (slot genesFromBestToWorst)

     '_g_e_t_M_o_d_e_l_s(_f_i_n_a_l_C_l_a_s_s_i_f_i_e_r)' Retreive the svm models for each size
          of subset (slot models)

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

     Camille Maumet

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

     'finalClassifier','assessment', 'getFinalClassifier-methods'

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

     #dataPath <- file.path("C:", "Documents and Settings", "c.maumet", "My Documents", "Programmation", "Sources", "SVN", "R package", "data")
     #aDataset <- new("dataset", dataId="vantVeer_70", dataPath=dataPath)
     #aDataset <- loadData(aDataset)
     data('vV70genesDataset')

     mySubsets <- new("geneSubsets", optionValues=c(1,2,4,8,16,32,64,70))
     expeOfInterest <- new("assessment", dataset=vV70genes,
                                    noFolds1stLayer=10,
                                    noFolds2ndLayer=9,
                                    classifierName="svm",
                                    typeFoldCreation="original",
                                    svmKernel="linear",
                                    noOfRepeat=2,
                                    featureSelectionOptions=mySubsets)

     expeOfInterest <- findFinalClassifier(expeOfInterest)

     # Return the whole object of class finalClassifier
     finalClassifier <- getFinalClassifier(expeOfInterest)

     # Svm model corresponding to a subset of size 4 (3rd size of subset)
     getModels(finalClassifier)[[3]]$model
     # Relevant genes for a subset of size 4 (3rd size of subset)
     getModels(finalClassifier)[[3]]$modelFeatures

     # Genes ordered according to their weight after performing the RFE up to 1 gene
     getGenesFromBestToWorst(finalClassifier)

