Skip to content
Snippets Groups Projects
Commit 8f123b56 authored by Helfenstein, Anatol's avatar Helfenstein, Anatol :speech_balloon:
Browse files

corrected directory path

parent 0f4e3a26
No related branches found
No related tags found
No related merge requests found
......@@ -174,37 +174,6 @@ if (COV > 33) {
# path = paste0("out/figs/models/", TARGET, "/", TIME_DIR),
# width = 8, height = 8)
# local variable importance (for each sample)
# ATTENTION: check if this is correct!
# if (is.null(QRF_FIT_optimal$finalModel$variable.importance.local)) {
# tbl_var_imp_local <- as_tibble(QRF_FIT_optimal$finalModel$variable.importance.local) %>%
# bind_cols(tbl_regmat_target %>%
# filter(split %in% "train") %>%
# dplyr::select(split:hor),
# .) %>%
# rownames_to_column('id') %>%
# gather(covariate, count, d_upper:water_wetness_probability_2015_1km) %>%
# group_by(id) %>%
# slice(which.max(count)) %>%
# ungroup()
#
# # plot local variable importance
# p_var_imp_local <- plyr::count(tbl_var_imp_local, vars = "covariate") %>%
# as_tibble() %>%
# filter(!freq %in% 1) %>%
# ggplot(., aes(y = reorder(covariate, freq))) +
# geom_bar(aes(weight = freq)) +
# xlab("Local variable importance") +
# ylab("Covariates") +
# theme_bw()
# }
# save plot to disk
# ggsave(paste0("p_QRF_", TARGET, "_var_imp_local.pdf"),
# p_var_imp_local,
# path = paste0("out/figs/models/", TARGET, "/", TIME_DIR),
# width = 6, height = 8)
### Global xML method 2: partial dependence plots (PDP) ========================
......@@ -263,7 +232,7 @@ p_pd_mean <- gridExtra::grid.arrange(grobs = ls_p_pd_mean,
ggsave(paste0("p_QRF_", TRANSFORM, TARGET, OBS_QUAL, TIME,
"_var_imp_PDP_1dim_mean_all_cov.pdf"),
p_pd_mean,
path = paste0("out/figs/models/", TARGET, "/", TIME_DIR, "/", OBS_QUAL),
path = paste0("out/figs/models/", TARGET, "/", TIME_DIR),
width = 20, height = 20)
......@@ -351,7 +320,7 @@ p_pd_quant <- gridExtra::grid.arrange(grobs = ls_p_pd_quant,
ggsave(paste0("p_QRF_", TRANSFORM, TARGET, OBS_QUAL, TIME,
"_var_imp_PDP_1dim_quant_all_cov.pdf"),
p_pd_quant,
path = paste0("out/figs/models/", TARGET, "/", TIME_DIR, "/", OBS_QUAL),
path = paste0("out/figs/models/", TARGET, "/", TIME_DIR),
width = 20, height = 20)
......@@ -421,7 +390,7 @@ p_pd_mean_2dim_all <- gridExtra::grid.arrange(grobs = ls_p_pd_mean_2dim,
ggsave(paste0("p_QRF_", TRANSFORM, TARGET, OBS_QUAL, TIME,
"_var_imp_PDP_2dim_mean_all_cov.pdf"),
p_pd_mean_2dim_all,
path = paste0("out/figs/models/", TARGET, "/", TIME_DIR, "/", OBS_QUAL),
path = paste0("out/figs/models/", TARGET, "/", TIME_DIR),
width = 30, height = 30)
# same as above but for MEDIAN predictions...
......@@ -457,7 +426,7 @@ p_pd_median_2dim_all <- gridExtra::grid.arrange(grobs = ls_p_pd_median_2dim,
ggsave(paste0("p_QRF_", TRANSFORM, TARGET, OBS_QUAL, TIME,
"_var_imp_PDP_2dim_median_all_cov.pdf"),
p_pd_median_2dim_all,
path = paste0("out/figs/models/", TARGET, "/", TIME_DIR, "/", OBS_QUAL),
path = paste0("out/figs/models/", TARGET, "/", TIME_DIR),
width = 30, height = 30)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment