-
Notifications
You must be signed in to change notification settings - Fork 6
/
slides-eRum2020.Rmd
157 lines (95 loc) · 3.23 KB
/
slides-eRum2020.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
---
title: "eRum 2020"
output:
xaringan::moon_reader:
seal: false
lib_dir: libs
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
---
```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
knitr::opts_chunk$set(echo = FALSE, fig.align = 'center')
```
class: title-slide center middle inverse
# Ultra fast penalized regressions<br>with `r icon::fa_r_project()` package {bigstatsr}
<br>
## e-Rum 2020
<br>
### Florian Privé (@privefl)
#### postdoc in *Predictive Human Genetics*
---
## {bigstatsr} uses memory-mapping
```{r, out.width='85%'}
knitr::include_graphics("memory-solution.svg")
```
.footnote[`FBM` is very similar to `filebacked.big.matrix` from package {bigmemory}.]
---
## Penalized linear regression
<br>
with **lasso** ( $\alpha=1$ ) or **elastic-net** regularization ( $0 < \alpha < 1$ )
$$L(\lambda, \alpha) = \underbrace{ ||y - X \beta||_2^2 }_\text{Loss function} + \underbrace{ \lambda \left( \alpha \|\beta\|_1 + (1-\alpha) \frac{\|\beta\|_2^2}{2} \right) }_\text{Penalisation}$$
<br>
Two hyper-parameters in this model:
- $\lambda$
- $\alpha$
---
## Science and Implementation
### behind the penalized regression framework of {bigstatsr}
<br>
- Mostly implemented in **C++**
- Use **strong rules** to discard variables a priori
- Use **early-stopping** to avoid fitting costly models
- Process the hyper-parameter **grid in parallel** <br>(memory-mapping makes it easy and efficient)
.footnote[Strong rules: DOI: [10.1111%2Fj.1467-9868.2011.01004.x](https://doi.org/10.1111/j.1467-9868.2011.01004.x)]
---
## Predicting common diseases from genetics
15K $\times$ 280K (30 GB) in **a few minutes**
```{r, out.width='85%'}
knitr::include_graphics("density-scores.svg")
```
---
## Predicting height from genetics
350K $\times$ 560K (1.4 TB) in **one day**
```{r, out.width='85%'}
knitr::include_graphics("https://privefl.github.io/blog/images/UKB-final-pred.png")
```
---
class: inverse, center, middle
# `r icon::fa_r_project()` package {bigstatsr}
# makes it possible
# to fit penalized regressions
# on 100s of GB of data
---
## Scientific publications
<br>
<a href="https://doi.org/10.1093/bioinformatics/bty185" target="_blank">
```{r, out.width='70%'}
knitr::include_graphics("bty185.png")
```
</a>
<br>
- {bigstatsr}: to be used by any field of research
- {bigsnpr}: algorithms specific to my field of research, Human Genetics
<br>
<a href="https://doi.org/10.1534/genetics.119.302019" target="_blank">
```{r, out.width='70%'}
knitr::include_graphics("paper2-2.PNG")
```
</a>
---
## Contributions are welcome!
```{r, out.width='75%'}
knitr::include_graphics("cat-help.jpg")
```
---
class: inverse, center, middle
# Thanks!
<br/><br/>
#### Go check the package website and the vignette!
<!-- Package's website: https://privefl.github.io/bigstatsr/ -->
<br/>
`r icon::fa("twitter")` [privefl](https://twitter.com/privefl) `r icon::fa("github")` [privefl](https://github.com/privefl) `r icon::fa("stack-overflow")` [F. Privé](https://stackoverflow.com/users/6103040/f-priv%c3%a9)
.footnote[Slides created using `r icon::fa_r_project()` package [**xaringan**](https://github.com/yihui/xaringan).]