-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.Rmd
215 lines (156 loc) · 6.67 KB
/
index.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
---
title: "Machine Learning in R"
subtitle: "Modeling Workflows with Tidymodels"
author: "Simon Schölzel"
institute: "*Research Team Berens*"
date: "Winter Term 2021/2022"
output:
xaringan::moon_reader:
seal: false
css: [./custom/xaringan-themer.css, ./custom/custom-theme.css]
lib_dir: libs
nature:
titleSlideClass: [left, middle, inverse]
highlightStyle: github
countIncrementalSlides: false
ratio: '16:9'
---
```{r setup, include=F}
# knitr options
knitr::opts_chunk$set(
comment = ">",
collapse = F
)
# package management
if (!require("pacman")) install.packages("pacman")
pacman::p_load(
xaringanthemer, xaringanExtra, metathis,
tidyverse, tidymodels, tidytuesdayR, skimr, themis, glmnet, doParallel, usemodels
)
pacman::p_load_gh("hadley/emo", "gadenbuie/xaringanExtra")
# xaringan custom setup
xaringanthemer::style_mono_accent(
base_color = "#000000",
link_color = "#0000EE",
header_font_google = google_font("Josefin Sans"),
text_font_google = google_font("Montserrat", "700b", "400"),
code_font_google = google_font("Fira Mono"),
colors = c(red = "#f34213", white = "#FFFFFF"),
code_font_size = "smaller",
code_inline_background_color = "#F4F4F4",
outfile = "./custom/xaringan-themer.css"
)
xaringanExtra::use_panelset()
xaringanExtra::use_webcam()
xaringanExtra::use_extra_styles(
hover_code_line = T,
mute_unhighlighted_code = T
)
metathis::meta() %>%
meta_name("github-repo" = "simonschoe/ml-with-tidymodels") %>%
meta_social(
title = "Modeling Workflows with Tidymodels",
description = "Video series on tidymodels, a unified framework towards modeling and machine learning in R using tidy data principles.",
url = "https://simonschoe.github.io/ml-with-tidymodels",
image = "https://simonschoe.github.io/ml-with-tidymodels/img/share-card.png",
image_alt = "Title slide for Modeling Workflows with Tidymodels",
og_type = "website",
og_author = "Simon Schölzel",
twitter_card_type = "summary_large_image"
)
```
class: center, middle, hide-count
count: false
# `r rmarkdown::metadata$title`
### `r rmarkdown::metadata$subtitle`
___
**`r rmarkdown::metadata$author`**
`r rmarkdown::metadata$date`
.small[(updated: `r Sys.Date()`)]
<br><br>
<a href="https://www.wiwi.uni-muenster.de/"><img src="https://www.wiwi.uni-muenster.de/fakultaet/sites/all/themes/wwucd/assets/images/logos/secondary_wiwi_aacsb_german.jpg" alt="fb4-logo" height="45"></a> <a href="https://www.wiwi.uni-muenster.de/ctrl/aktuelles"><img src="https://www.wiwi.uni-muenster.de/ctrl/sites/all/themes/wwucd/assets/images/logos/berenslogo5.jpg" alt="ftb-logo" height="45"></a> <a href="https://www.wiwi.uni-muenster.de/iff2/de/news"><img src="https://www.wiwi.uni-muenster.de/iff2/sites/all/themes/wwucd/assets/images/logos/logo_iff2_en2.jpg" alt="ipb-logo" height="45"></a>
---
name: agenda
## Agenda
**1 Learning Objectives**
**2 Introduction to `tidymodels`**
**3 Himalayan Climbing Expeditions Data**
**4 The Core `tidymodels` Packages**
>4.1 `rsample`: General Resampling Infrastructure
4.2 `recipes`: Preprocessing Tools to Create Design Matrices
4.3 `parsnip`: A Common API to Modeling and Analysis Functions
4.4 `workflows`: Modeling Workflows
4.5 `dials`: Tools for Creating Tuning Parameter Values
4.6 `tune`: Tidy Tuning Tools
4.7 `broom`: Convert Statistical Objects into Tidy Tibbles
4.8 `yardstick`: Tidy Characterizations of Model Performance
**5 Additions to the `tidymodels` Ecosystem**
---
## 1 Learning Objectives `r emo::ji("idea")`
This workshop introduces `tidymodels`, a unified framework towards modeling and machine learning in `R` using tidy data principles. You will get to know tools that facilitate every step of your machine learning workflow, from resampling, over preprocessing and model building, to model tuning and performance evaluation.
More specifically, after this lecture you will
- be familiar with the core packages of the `tidymodels` ecosystem and hopefully realize the value of a unified modeling framework,<br><br>
- know how to design a full-fledged machine learning pipeline for a particular prediction task,<br><br>
- broaden your technical skill set by learning about declarative programming, hyperparameter scales and parallel processing, and<br><br>
- most importantly, be capable of conducting your own machine learning projects in `R`.
---
```{r child='./01_intro.Rmd', eval=T}
```
---
```{r child='./02_resampling.Rmd', eval=T}
```
---
```{r child='./03_preprocessing.Rmd', eval=T}
```
---
```{r child='./04_model_building.Rmd', eval=T}
```
---
```{r child='./05_workflows.Rmd', eval=T}
```
---
```{r child='./06_tuning.Rmd', eval=T}
```
---
```{r child='./07_model_evaluation.Rmd', eval=T}
```
---
## 5 Additions to the `tidymodels` Ecosystem
Similar to the `tidyverse` ecosystem, there is already a promising supply of complementary packages that further improve the capabilities of `tidymodels`, e.g.:
```{r, echo=F, out.height='40%', out.width='40%', out.extra='style="float:right; padding: 30px"'}
knitr::include_graphics("https://tenor.com/view/shocked-po-kung-fu-panda-gif-4255877.gif")
```
- `textrecipes`: Extra recipes for text processing
- `baguette`: Efficient model functions for bagging
- `stacks`: Tidy model stacking
- `probably`: Tools for post-processing class probability estimates
- `infer`: Statistical inference and hypothesis testing using tidy data principles
- `finetune`: Implementation of additional search algorithms
- `usemodels`: Boilerplate code for `tidymodels` analyses
???
- textrecipes as extension to the recipes package for natural language processing
- baguette as add-on to the parsnip package
- stacking: ensemble technique to integrate the predictions of multiple models into a meta-model
- probably enables the identification of optimal probability thresholds and equivocal zones (uncertain probability regions)
- infer:
---
## Thank You!
.pull-left[
.center[`r emo::ji("thinking_face")` **Right now**]<br><br>
```{r, echo=F, fig.align='center'}
knitr::include_graphics("https://tenor.com/view/homer-daydreaming-thinking-simpsons-gif-8949118.gif")
```
]
.pull-right[
.center[`r emo::ji("nerd_face")` **After having mastered `tidymodels`**]<br><br>
```{r, echo=F, fig.align='center'}
knitr::include_graphics("https://tenor.com/view/homer-gif-10571731.gif")
```
]
---
## Further Resources
**Kuhn, M./Silge, J. (2021):** Tidy Modeling in R. URL: https://www.tmwr.org (work-in-progress).
[Learn section](https://www.tidymodels.org/learn/) of tidymodels.org.
[TidyTuesday contributions](https://juliasilge.com/blog/) by Julia Silge.
## Credits
`tidymodels` [artworks and illustration](https://github.com/allisonhorst/stats-illustrations) are provided by Allison Horst.