-
Notifications
You must be signed in to change notification settings - Fork 24
/
7-challenge.Rmd
41 lines (29 loc) · 1.78 KB
/
7-challenge.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
---
title: "Challenge"
output: html_document
---
# About
In this chapter, you will test your knowledge and build a complete pipeline from scratch. Requirements:
1. Create a dataset and recipe target for each dataset in `data/`.
2. Fit a model to each dataset for each activation function (relu, sigmoid, softmax) for a total of 9 models.
3. Identify the highest-accuracy model. (No need to retrain it at the end.)
Tips:
1. As you write code, remember the incremental development strategy discussed in `2-pipelines.Rmd`: write the first targets, then explore them, then add new targets gradually. Remember to check the graph and the manifest early and often.
2. Formal branching, e.g. `tar_target(pattern = map(...))` will help in some places, but not others. Throughout this short course, sometimes we branched over hyperparameters, while other times we branched over datasets. If you try to use branching everywhere, you risk overcomplicating the problem. And if you use branching nowhere, you will need to type out every single model by hand, which is not the recommended solution here.
3. You may wish to use static branching functions `tar_map()` and `tar_combine()` from the `tarchetypes` package, but this is not required.
4. This chapter includes a modified set of functions in `7-challenge/functions.R`. `test_model()` now omits some hyperparameters but includes the sizes of the training and testing datasets. Here is an example collection of model runs. So the model runs should look like the rows of this data frame.
```{r}
readRDS("7-challenge/runs.rds")
```
# Setup
Start with a fresh data store.
```{r}
library(targets)
tar_destroy()
```
Begin with a blank `_targets.R` file.
```{r}
unlink("_targets.R")
tar_edit()
```
One possible solution is at the bottom of `7-challenge/solution_targets.R`.