barPlotModelComparison-ClinicalModel-PCOSP_or_RLS_or_RGA-method: Make a Bar Plot Comparison Model Performance Between a...

Description Usage Arguments Value Examples

Description

Make a Bar Plot Comparison Model Performance Between a ClinicalModel and a PCOSP, RLSModel or RGAModel object.

Usage

1
2
## S4 method for signature 'ClinicalModel,PCOSP_or_RLS_or_RGA'
barPlotModelComparison(model1, model2, stat, ...)

Arguments

model1

A ClinicalModel object.

model2

A PCOSP or RLSModel or RGAModel object.

stat

A character vector specifying which statistic to compare the models using. Options are 'AUC', 'log_D_index' or 'concordance_index'.

...

Not used.

Value

A ggplot2 object showing a barplot coloured by the model and comparing the stat between all cohorts that both models were validated with.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
data(sampleValPCOSPmodel)
data(sampleCohortList)
data(sampleICGCmicro)

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

# Setup the models
clinicalModel <- ClinicalModel(sampleICGCmicro,
  formula='prognosis ~ sex + age + T + N + M + grade',
  randomSeed=1987)

# Train the models
trainedClinicalModel <- trainModel(clinicalModel)

# Make predctions
clinicalPredCohortList <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')],
  model=trainedClinicalModel)

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

# Plot the comparison
modelCompBarPlot <- barPlotModelComparison(validatedClinicalModel,
 sampleValPCOSPmodel, stat='AUC')

bhklab/PanCuRx documentation built on Dec. 30, 2021, 4:59 p.m.