Skip to content

Commit

Permalink
classifier
Browse files Browse the repository at this point in the history
  • Loading branch information
franzbischoff committed Jun 23, 2023
1 parent 3ece741 commit 56718b8
Show file tree
Hide file tree
Showing 31 changed files with 1,817 additions and 196 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ RUN echo "C.UTF-8 en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen en_US.utf8 \
&& /usr/sbin/update-locale LANG=en_US.UTF-8

ENV R_BASE_VERSION 4.2.1
ENV R_BASE_VERSION 4.3.0
ENV RENV_PATHS_ROOT "${HOME_WORK}/.cache/R/renv"
ENV RENV_PATHS_LIBRARY_ROOT "${HOME_WORK}/.cache/R/renv/library"
ENV TZ UTC
Expand Down
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ alarms <- tribble(
"Ventricular Flutter/Fibrillation", "Fibrillatory, flutter, or oscillatory waveform for at least 4 seconds"
)

kbl(alarms, booktabs = TRUE, caption = "Definition of the 5 alarm types used in CinC/Physionet Challenge 2015 challenge.", align = "ll") %>%
kable_styling(full_width = TRUE) %>%
column_spec(1, width = "5cm") %>%
kbl(alarms, booktabs = TRUE, caption = "Definition of the 5 alarm types used in CinC/Physionet Challenge 2015 challenge.", align = "ll") |>
kable_styling(full_width = TRUE) |>
column_spec(1, width = "5cm") |>
row_spec(0, bold = TRUE)
```

Expand Down
5 changes: 5 additions & 0 deletions _contrast_profile_ex/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!.gitignore
!meta
meta/*
!meta/meta
498 changes: 498 additions & 0 deletions _contrast_profile_ex/meta/meta

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions _targets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ classifier:
script: scripts/_classifier.R

contrast_profile:
inherits: main
store: _contrast_profile_ex
script: scripts/_contrast_profile_ex.R

contrast_profile_not:
inherits: main
store: _contrast_profile
script: scripts/_contrast_profile.R
Expand Down
2 changes: 1 addition & 1 deletion analysis/index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Last Targets Run network:
```{r network, echo=FALSE, fig.width=10}
library(magrittr)
network <- readRDS(here("output/network.rds"))
network <- network %>%
network <- network |>
visNetwork::visPhysics(hierarchicalRepulsion = list(
springLength = 1,
avoidOverlap = 0.5,
Expand Down
15 changes: 7 additions & 8 deletions analysis/regime_optimize.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ my_graphics <- function(image_name, base_path = here::here("docs", "figure")) {
}

my_plot_html <- function(html, options) {
structure(paste0(
"<div class=\"figure\" style=\"text-align: ",
options$fig.align, "\">", html, "<p class=\"caption\">(#",
options$fig.lp, options$label, ")", options$fig.cap, "</p></div>"
),
class = "knit_asis"
structure(
paste0(
"<div class=\"figure\" style=\"text-align: ",
options$fig.align, "\">", html, "<p class=\"caption\">(#",
options$fig.lp, options$label, ")", options$fig.cap, "</p></div>"
),
class = "knit_asis"
)
}

Expand Down Expand Up @@ -1229,8 +1230,6 @@ my_plot_html(shap_html_test2, knitr::opts_current$get())


```{r tests, eval=FALSE, echo=FALSE, out.width="80%", fig.cap="FLOSS pipeline."}


# all_scores2 <- all_scores %>% dplyr::mutate(test = score_regimes_precision(truth, pred, 0,
# window = 250,
# delta_prec = "flat",
Expand Down
18 changes: 8 additions & 10 deletions analysis/report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ kbl(alarms,
align = "ll",
position = "ht",
linesep = "\\addlinespace"
) %>%
row_spec(0, bold = TRUE) %>%
) |>
row_spec(0, bold = TRUE) |>
kable_styling(full_width = TRUE)
```

Expand All @@ -231,7 +231,6 @@ For comparison, on Table \@ref(tab:challenge) we collected the score of the five
of the challenge [@plesinger2015; @kalidas2015; @couto2015; @fallet2015; @hoogantink2015].
```{r challenge, echo=FALSE}
challenge <- tribble(
~Score, ~Authors,
"81.39", "Filip Plesinger, Petr Klimes, Josef Halamek, Pavel Jurak",
Expand All @@ -246,10 +245,10 @@ kbl(challenge,
caption = "Challenge Results on real-time data. The scores were multiplied by 100.",
align = "cl",
position = "ht"
) %>%
row_spec(0, bold = TRUE) %>%
# column_spec(1, width = "5em") %>%
# column_spec(2, width = "30em") %>%
) |>
row_spec(0, bold = TRUE) |>
# column_spec(1, width = "5em") |>
# column_spec(2, width = "30em") |>
kable_styling(full_width = TRUE)
```
Expand Down Expand Up @@ -317,8 +316,8 @@ kbl(criteria,
align = "ll",
position = "ht",
linesep = "\\addlinespace"
) %>%
row_spec(0, bold = TRUE) %>%
) |>
row_spec(0, bold = TRUE) |>
kable_styling(full_width = TRUE)
```
Expand Down Expand Up @@ -1034,7 +1033,6 @@ floss_data_1250 <- get_dist(0, 1250)
```
```{r distributions, echo=FALSE, fig.cap="1D-IAC distributions for earlier temporal constraint (on Matrix Profile).", message=FALSE, warning=FALSE}
floss_dist <- ggplot(data_5000, aes(index, counts)) +
geom_line(size = 0.1) +
ggtitle("a) No constraint") +
Expand Down

0 comments on commit 56718b8

Please sign in to comment.