compareModels,SurvivalModel,SurvivalModel-method {PDATK}R Documentation

Compare Two SurivalModel Objects, Returing A ModelComparison Object With Statistics Comparing the Performance of Each Model.

Description

Compare Two SurivalModel Objects, Returing A ModelComparison Object With Statistics Comparing the Performance of Each Model.

Usage

## S4 method for signature 'SurvivalModel,SurvivalModel'
compareModels(model1, model2, modelNames)

Arguments

model1

An object inherting from the SurvivalModel class.

model2

Another object inherting from the SurvivalModel class

modelNames

Optional character vector with a name for each model. Defaults to the class of the model plus 1 and 2 if missing.

Value

A ModelComparison object with statistics comparing the two models.

Examples

data(sampleValPCOSPmodel)
data(sampleClinicalModel)
data(sampleCohortList)

# Set parallelization settings
BiocParallel::register(BiocParallel::SerialParam())

# Train the model
trainedClinicalModel <- trainModel(sampleClinicalModel)

# Predict risk/risk-class
ClinicalPredPCSI <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')],
  model=trainedClinicalModel)

# Validate the models
validatedClinicalModel <- validateModel(trainedClinicalModel,
  valData=ClinicalPredPCSI)

# Compare the models
modelComp <- compareModels(sampleValPCOSPmodel, validatedClinicalModel)
head(modelComp)


[Package PDATK version 1.2.0 Index]