Skip to contents

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

characteristics

A DataFrame describing 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.

originalNames

All sample names.

originalFeatures

All feature names. Character vector or DataFrame with one row for each feature if the data set has multiple kinds of measurements on the same set of samples.

chosenFeatures

Features selected at each fold. Character vector or a data frame if data set has multiple kinds of measurements on the same set of samples.

models

All of the models fitted to the training data.

tunedParameters

Names of tuning parameters and the value chosen of each parameter.

predictions

A data frame containing sample IDs, predicted class or risk and information about the cross-validation iteration in which the prediction was made.

actualOutcome

The known class or survival data of each sample.

importance

The changes in model performance for each selected variable when it is excluded.

modellingParams

Stores the object used for defining the model building to enable future reuse.

finalModel

A 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

result is a ClassifyResult object.

show(result): Prints a short summary of what result contains.

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 list of 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 list of the features selected for each training.

predictions(result)

Returns a DataFrame which has columns with test sample, cross-validation and prediction information.

performance(result)

Returns a list of performance measures. This is empty until calcCVperformance has been used.

tunedParameters(result)

Returns a list of 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.

Author

Dario Strbenac

Examples


  #if(require(sparsediscrim))
  #{
    data(asthma)
    classified <- crossValidate(measurements, classes, nRepeats = 5)
#> Warning: multiple methods tables found for ‘sort’
    class(classified)
#> [1] "ClassifyResult"
#> attr(,"package")
#> [1] "ClassifyR"
  #}