Skip to content

Commit e9166c6

Browse files
author
ercbk
committed
added percent error to perf exp; readme edits
1 parent e6a884f commit e9166c6

File tree

5 files changed

+47
-39
lines changed

5 files changed

+47
-39
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
.env
66
.drake
77
ec2-ssh-raw.log
8-
README_cache
8+
README_cache
9+
check-results.R

README.Rmd

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ Experiment details:
110110

111111
* The fastest implementation of each method will be used in running a nested cross-validation with different sizes of data ranging from 100 to 5000 observations and different numbers of repeats of the outer-loop cv strategy.
112112
* The {mlr3} implementation was the fastest for Raschka's method, but the Ranger-Kuhn-Johnson implementation was close. To simplify, I'll be using Ranger-Kuhn-Johnson for both methods.
113-
* The chosen algorithm and hyperparameters will used to predict on a 100K row simulated dataset and the mean absolute error will be calculated for each combination of repeat, data size, and method.
114-
* Runtimes began to explode after n = 800 for my 8 vcpu, 16 GB RAM desktop, therefore I ran this experiment using AWS instances: a r5.2xlarge for the Elastic Net and a r5.24xlarge for Random Forest.
115-
* I'll be transitioning from imperative scripts to a functional approach, because I'm iterating through different numbers of repeats and sample sizes. Given the long runtimes and impermanent nature of my internet connection, it would also be nice to cache each iteration as it finishes. The [{drake}](https://github.com/ropensci/drake) package is superb on both counts, so I'm using it to orchestrate.
113+
* The chosen algorithm and hyperparameters will be used to predict on a 100K row simulated dataset.
114+
* The percent error between the the average mean absolute error (MAE) across the outer-loop folds and the MAE of the predictions on this 100K dataset will be calculated for each combination of repeat, data size, and method.
115+
* To make this experiment manageable in terms of runtimes, I'm using AWS instances: a r5.2xlarge for the Elastic Net and a r5.24xlarge for Random Forest.
116+
* Iterating through different numbers of repeats, sample sizes, and methods makes a functional approach more appropriate than running imperative scripts. Also, given the long runtimes and impermanent nature of my internet connection, it would also be nice to cache each iteration as it finishes. The [{drake}](https://github.com/ropensci/drake) package is superb on both counts, so I'm using it to orchestrate.
116117

117118
```{r perf_build_times, echo=FALSE, message=FALSE, cache=TRUE}
118119
@@ -134,7 +135,8 @@ subtargets_raw <- map_dfr(subtarget_bts$target, function(x) {
134135
subtargets <- subtargets_raw %>%
135136
mutate(repeats = factor(repeats),
136137
n = factor(n),
137-
elapsed = round(as.numeric(elapsed)/3600, 2))
138+
elapsed = round(as.numeric(elapsed)/3600, 2),
139+
percent_error = round(delta_error/oos_error, 3))
138140
139141
```
140142

@@ -168,7 +170,29 @@ ggplot(subtargets, aes(y = elapsed, x = repeats,
168170
169171
```
170172

171-
173+
```{r perf-error-line, echo=FALSE, message=FALSE}
174+
ggplot(subtargets, aes(x = repeats, y = percent_error, group = n)) +
175+
geom_point(aes(color = n), size = 3) +
176+
geom_line(aes(color = n), size = 2) +
177+
expand_limits(y = c(0, 0.10)) +
178+
scale_y_continuous(labels = scales::percent_format(accuracy = 0.1)) +
179+
scale_color_manual(values = fill_colors[4:7]) +
180+
labs(y = "Percent Error", x = "Repeats",
181+
title = "Kuhn-Johnson", color = "Sample Size") +
182+
theme(title = element_text(family = "Roboto"),
183+
text = element_text(family = "Roboto"),
184+
legend.position = "top",
185+
legend.background = element_rect(fill = "ivory"),
186+
legend.key = element_rect(fill = "ivory"),
187+
axis.ticks = element_blank(),
188+
panel.background = element_rect(fill = "ivory",
189+
colour = "ivory"),
190+
plot.background = element_rect(fill = "ivory"),
191+
panel.border = element_blank(),
192+
panel.grid.major = element_blank(),
193+
panel.grid.minor = element_blank()
194+
)
195+
```
172196

173197

174198

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,27 @@ Experiment details:
8989
- The {mlr3} implementation was the fastest for Raschka’s method,
9090
but the Ranger-Kuhn-Johnson implementation was close. To
9191
simplify, I’ll be using Ranger-Kuhn-Johnson for both methods.
92-
- The chosen algorithm and hyperparameters will used to predict on a
93-
100K row simulated dataset and the mean absolute error will be
94-
calculated for each combination of repeat, data size, and method.
95-
- Runtimes began to explode after n = 800 for my 8 vcpu, 16 GB RAM
96-
desktop, therefore I ran this experiment using AWS instances: a
97-
r5.2xlarge for the Elastic Net and a r5.24xlarge for Random
98-
Forest.
99-
- I’ll be transitioning from imperative scripts to a functional
100-
approach, because I’m iterating through different numbers of repeats
101-
and sample sizes. Given the long runtimes and impermanent nature of
102-
my internet connection, it would also be nice to cache each
103-
iteration as it finishes. The
92+
- The chosen algorithm and hyperparameters will be used to predict on
93+
a 100K row simulated dataset.
94+
- The percent error between the the average mean absolute error (MAE)
95+
across the outer-loop folds and the MAE of the predictions on this
96+
100K dataset will be calculated for each combination of repeat, data
97+
size, and method.
98+
- To make this experiment manageable in terms of runtimes, I’m using
99+
AWS instances: a r5.2xlarge for the Elastic Net and a r5.24xlarge
100+
for Random Forest.
101+
- Iterating through different numbers of repeats, sample sizes, and
102+
methods makes a functional approach more appropriate than running
103+
imperative scripts. Also, given the long runtimes and impermanent
104+
nature of my internet connection, it would also be nice to cache
105+
each iteration as it finishes. The
104106
[{drake}](https://github.com/ropensci/drake) package is superb on
105107
both counts, so I’m using it to orchestrate.
106108

107109
![](README_files/figure-gfm/perf_bt_charts-1.png)<!-- -->
108110

111+
![](README_files/figure-gfm/perf-error-line-1.png)<!-- -->
112+
109113
References
110114

111115
Boulesteix, AL, and C Strobl. 2009. “Optimal Classifier Selection and
5.82 KB
Loading

performance-experiment/Kuhn-Johnson/check-results.R

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)