Skip to content

Commit

Permalink
fix renv and minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
nhejazi committed May 15, 2023
1 parent a8fccad commit 6334e86
Show file tree
Hide file tree
Showing 2 changed files with 1,142 additions and 565 deletions.
39 changes: 21 additions & 18 deletions 06-sl3.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,17 @@ The Super Learner (SL) solves the issue of selecting an algorithm, as it can
consider many of them - from the simplest parametric regressions to the most
complex machine learning algorithms (e.g., neural nets, support vector machines,
etc). Additionally, it is proven to perform as well as possible
(as good as the unknown oracle) in large samples, given the learners specified [@vdl2003unified; @vdl2004asymptotic; @dudoit2005asymptotics; @vaart2006oracle]. The SL represents an entirely pre-specified, flexible, and theoretically grounded approach for
predictive modeling. It has been shown to be adaptive and robust in a variety of
applications, even in very small samples. Detailed descriptions outlining
the SL procedure are widely available [@polley2010super; @naimi2018stacked].
Practical considerations for specifying the SL, including how to specify a rich
and diverse library of learners, choose a performance metric for the SL, and
specify a cross-validation (CV) scheme, are described in a pre-print article
[@rvp2022super]. Here, we focus on introducing `sl3`, the standard `tlverse`
software package for SL.
(as good as the unknown oracle) in large samples, given the learners specified
[@vdl2003unified; @vdl2004asymptotic; @dudoit2005asymptotics; @vaart2006oracle].
The SL represents an entirely pre-specified, flexible, and theoretically
grounded approach for predictive modeling. It has been shown to be adaptive and
robust in a variety of applications, even in very small samples. Detailed
descriptions outlining the SL procedure are widely available [@polley2010super;
@naimi2018stacked]. Practical considerations for specifying the SL, including
how to specify a rich and diverse library of learners, choose a performance
metric for the SL, and specify a cross-validation (CV) scheme, are described in
a pre-print article [@rvp2022super]. Here, we focus on introducing `sl3`, the
standard `tlverse` software package for SL.

<!--
IM:
Expand Down Expand Up @@ -104,12 +106,13 @@ Fitting any SL with `sl3` consists of the following three steps:

#### Running example with WASH Benefits dataset {-}

We will use the WASH Benefits Bangladesh study as an example to guide this
overview of `sl3`. In this study, we are interested in predicting the child development outcome, weight-for-height z-score, from covariates/predictors,
including socio-economic status variables, gestational age, and maternal
features. More information on this dataset is described in the ["Meet
the Data"](https://tlverse.org/tlverse-handbook/data.html#wash) chapter of the
`tlverse` handbook.
We will use the WASH Benefits Bangladesh study as an example to guide this
overview of `sl3`. In this study, we are interested in predicting the child
development outcome, weight-for-height z-score, from covariates/predictors,
including socio-economic status variables, gestational age, and maternal
features. More information on this dataset is described in the ["Meet the
Data"](https://tlverse.org/tlverse-handbook/data.html#wash) chapter of the
`tlverse` handbook.

#### Preliminaries {-}

Expand All @@ -123,8 +126,8 @@ library(kableExtra)
library(data.table)
```

We will use the `fread` function in the `data.table` R package to load the
WASH Benefits example dataset:
We will use the `fread` function in the `data.table` R package to load the WASH
Benefits example dataset:

```{r load-data}
library(data.table)
Expand Down Expand Up @@ -1127,7 +1130,7 @@ Recall the SL object, `sl`, defined in section 2:
```{r recall-eSL}
# in the section 2 we defined Lrnr_sl as
# sl <- Lrnr_sl$new(learners = stack, metalearner = Lrnr_nnls$new())
````
```

`sl` is an eSL since it used NNLS as the meta-learner. We rename `sl` to
`eSL_metaNNLS` below to clarify that this is an eSL that uses NNLS as its
Expand Down
Loading

0 comments on commit 6334e86

Please sign in to comment.