finalClassifier-class: finalClassifier: A class to store the final classifier...

Description Creating objects Slots Methods Author(s) See Also Examples

Description

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.

Creating objects

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

Slots

genesFromBestToWorst:

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.

models:

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.

Methods

getGenesFromBestToWorst(finalClassifier)

Retreive the genes ordered by their weights obtained with the smallest subset during RFE (slot genesFromBestToWorst)

getModels(finalClassifier)

Retreive the svm models for each size of subset (slot models)

Author(s)

Camille Maumet

See Also

finalClassifier,assessment, getFinalClassifier-methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#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)

Rmagpie documentation built on Nov. 8, 2020, 11:09 p.m.