Container for Storing Classification Results
ClassifyResult-class.RdContains a list of models, table of actual sample classes and predicted
classes, the identifiers of features selected for each fold of each
permutation or each hold-out classification, and performance metrics such as
error rates. This class is not intended to be created by the user. It is
created by crossValidate, runTests or runTest.
Constructor
ClassifyResult(characteristics, originalNames, originalFeatures,
rankedFeatures, chosenFeatures, models, tunedParameters, predictions, actualOutcome, importance = NULL, modellingParams = NULL, finalModel = NULL)
characteristicsA
DataFramedescribing the characteristics of classification done. First column must be named"charateristic"and second column must be named"value". If using wrapper functions for feature selection and classifiers in this package, the function names will automatically be generated and therefore it is not necessary to specify them.originalNamesAll sample names.
originalFeaturesAll feature names. Character vector or
DataFramewith one row for each feature if the data set has multiple kinds of measurements on the same set of samples.chosenFeaturesFeatures selected at each fold. Character vector or a data frame if data set has multiple kinds of measurements on the same set of samples.
modelsAll of the models fitted to the training data.
tunedParametersNames of tuning parameters and the value chosen of each parameter.
predictionsA data frame containing sample IDs, predicted class or risk and information about the cross-validation iteration in which the prediction was made.
actualOutcomeThe known class or survival data of each sample.
importanceThe changes in model performance for each selected variable when it is excluded.
modellingParamsStores the object used for defining the model building to enable future reuse.
finalModelA model built using all of the samples for future use. For any tuning parameters, the most popular value of the parameter in cross-validation is used. May be missing if some cross-validated fittings failed. Could be of any class, depending on the R package used to fit the model.
Summary
resultis aClassifyResultobject.show(result): Prints a short summary of whatresultcontains.
Accessors
result is a ClassifyResult object.
sampleNames(result)Returns a vector of sample names present in the data set.
actualOutcome(result)Returns the known outcome of each sample.
models(result)A
listof the models fitted for each training.
finalModel(result)A deployable model fitted on all of the data for use on future data.
chosenFeatureNames(result)A
listof the features selected for each training.
predictions(result)Returns a
DataFramewhich has columns with test sample, cross-validation and prediction information.
performance(result)Returns a
listof performance measures. This is empty untilcalcCVperformancehas been used.
tunedParameters(result)Returns a
listof tuned parameter values. If cross-validation is used, this list will be large, as it stores chosen values for every iteration.
totalPredictions(result)A single number representing the total number. of predictions made during the cross-validation procedure.
Examples
#if(require(sparsediscrim))
#{
data(asthma)
classified <- crossValidate(measurements, classes, nRepeats = 5)
class(classified)
#> [1] "ClassifyResult"
#> attr(,"package")
#> [1] "ClassifyR"
#}