-
Notifications
You must be signed in to change notification settings - Fork 1
/
supplement.Rmd
85 lines (73 loc) · 2.3 KB
/
supplement.Rmd
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
title: "Supplement"
output:
bookdown::html_document2:
toc: false
bookdown::word_document2:
keep_md: true
---
```{r knitr_setup, include = FALSE}
```
```{r knitr_setup_word, eval = !knitr::is_html_output(), include = FALSE}
knitr::opts_chunk$set(dpi = 1200, dev = c("png", "pdf"))
```
```{r supplement_setup, echo = FALSE, message = FALSE}
library("ameld")
library("data.table")
library("targets")
library("mlr3")
library("mlr3misc")
library("mlr3proba")
library("mlr3viz")
library("viridis")
library("ggplot2")
```
# Benchmark results of machine learning algorithms
```{r benchmark-plot, fig.cap = "Benchmark results of machine learning algorithms.", echo = FALSE, fig.width = 18, fig.height = 12}
tar_load(bmrk_results)
r <- bmrk_results$clone()
id <- grep("^scale", x = r$learners$learner_id, invert = TRUE, value = TRUE)
r$filter(task_id = "zlog_eldd", learner_id = id)
autoplot(r) +
geom_boxplot(aes(fill = learner_id)) +
geom_jitter(position = position_jitter(0.2)) +
scale_fill_viridis(discrete = TRUE) +
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5))
```
```{r benchmark-table, echo = FALSE}
agg <- bmrk_results$aggregate(msr("surv.cindex", id = "harrell"))
agg[, `:=`
(nr = NULL, resample_result = NULL, resampling_id = NULL, iters = NULL)
]
agg <- subset(agg, task_id == "zlog_eldd" & !grepl("^scale", learner_id))
agg[, task_id := NULL]
setorder(agg, -harrell)
knitr::kable(agg, col.names = c("Learner ID", "Harrell C"))
```
# AUROC trend
```{r roc-plot, echo = FALSE, fig.width = 18, fig.height = 12}
tar_load(timeROC_MELD)
tar_load(timeROC_MELDNa)
tar_load(timeROC_MELDPlus7)
tar_load(timeROC_RCV)
m <- list(
AMELD = timeROC_RCV,
MELD = timeROC_MELD,
"MELD-Na" = timeROC_MELDNa,
"MELD-Plus7" = timeROC_MELDPlus7
)
plot_surv_roc_trend(m)
```
# Variable importance
```{r vimpbs, fig.width = 8, fig.height = 10, fig.cap = "Variable importance by frequency of bootstrap selections.", echo = FALSE, message = FALSE}
tar_load(bootrcv)
plot(bootrcv, what = "selected", cex = 0.5)
```
```{r vimprf, fig.width = 8, fig.height = 10, fig.cap = "Variable importance by logrank in random forest.", echo = FALSE, message = FALSE}
tar_load(rngr)
plot_dots(
sort(rngr$variable.importance),
main = "Variable importance (random forest)",
xlab = rngr$splitrule
)
```