compareModels,ModelComparison,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 'ModelComparison,SurvivalModel'
compareModels(model1, model2, model2Name)

Arguments

model1

An object inherting from the SurvivalModel class.

model2

Another object inherting from the SurvivalModel class

model2Name

A character vector with the name of the second model.

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 models
trainedClinicalModel <- trainModel(sampleClinicalModel)

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

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

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

# Compare model comparison to another model
modelCompComp <- compareModels(modelComp, sampleValPCOSPmodel)


[Package PDATK version 1.1.3 Index]