getFinalClassifier-methods {magpie}R Documentation

getFinalClassifier Method to access the attributes of a finalClassifier from an experiment

Description

This method provides an easy interface to access the attributes of the object of class finalClassifier related to a particular experiment, directly from this object experiment. The argument topic specifies which part of the finalClassifier is of interest.

Arguments

object Object of class experiment. Object experiment of interest
topic character. Optional argument that specifies which attribute of the finalClassifier is requested, the possible values are genesFromBestToWorst (slot genesFromBestToWorst of the finalClassifier), models (slot models of the finalClassifier), if the topic is missing then the whole finalClassifier object is returned.

Value

The value returned by the method changes accordingly to the topic argument.
If topic is missing object of class finalClassifier the finalClassifier corresponding to the experiment of interest
If topic is "genesFromBestToWorst" numeric corresponding to the genesFromBestToWorst of the finalClassifier
If topic is "models" numeric corresponding to the models of the finalClassifier

Methods

object = "experiment"
The method is only applicable on objects of class experiment.

Author(s)

Camille Maumet

See Also

finalClassifier, experiment

Examples

#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)

mySubsets <- new("geneSubsets", optionValues=c(1,2,3,4,5,6))
data('vV70genesDataset')

# Experiment with RFE and SVM
expeOfInterest <- new("experiment", 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
getFinalClassifier(expeOfInterest)
getFinalClassifier(expeOfInterest, 'genesFromBestToWorst')
getFinalClassifier(expeOfInterest, 'models')

# Experiment with NSC
expeOfInterest <- new("experiment", dataset=vV70genes,
                               noFolds1stLayer=10,
                               noFolds2ndLayer=9,
                               featureSelectionMethod='nsc',
                               classifierName="nsc",
                               typeFoldCreation="original",
                               svmKernel="linear",
                               noOfRepeat=2,
                               featureSelectionOptions=new("thresholds"))

expeOfInterest <- findFinalClassifier(expeOfInterest)

# Return the whole object of class finalClassifier
getFinalClassifier(expeOfInterest)
getFinalClassifier(expeOfInterest, 'genesFromBestToWorst')
getFinalClassifier(expeOfInterest, 'models')

[Package magpie version 0.2.0 Index]