Skip to content
An interactive workshop on drake
HTML JavaScript CSS R Other
Branch: master
Clone or download
Latest commit 1384bf1 Feb 23, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Public release Jun 11, 2019
R
inst Minor edit Feb 23, 2020
man Change app name Feb 9, 2020
tests Update tests Feb 10, 2020
.Rbuildignore Ignore rsconnect Feb 11, 2020
.gitignore Ignore rsconnect Feb 11, 2020
.lintr Use tibble printing Feb 10, 2020
.travis.yml Re-automate deployment of slides Feb 14, 2020
CODE_OF_CONDUCT.md Public release Jun 11, 2019
CONTRIBUTING.md Edit meta file Jul 3, 2019
DESCRIPTION Rm clustermq and zmq deps Feb 10, 2020
LICENSE Public release Jun 11, 2019
NAMESPACE Gradually build up plan in slides Feb 3, 2020
NEWS.md Update news Feb 10, 2020
README.Rmd Update README Feb 14, 2020
README.md Update README Feb 14, 2020
deploy.sh Suppress binder updates Feb 22, 2020
learndrake.Rproj Update slides Sep 17, 2019
shinyapps.R Change app name Feb 9, 2020

README.md

Launch RStudio Cloud Launch RStudio Binder Travis build status Codecov test coverage

Reproducible workflows at scale with drake

Ambitious workflows in R, such as machine learning analyses, can be difficult to manage. A single round of computation can take several hours to complete, and routine updates to the code and data tend to invalidate hard-earned results. You can enhance the maintainability, hygiene, speed, scale, and reproducibility of such projects with the drake R package. drake resolves the dependency structure of your analysis pipeline, skips tasks that are already up to date, executes the rest with optional distributed computing, and organizes the output so you rarely have to think about data files. This workshop will teach you how to create and maintain machine learning projects with drake-powered automation.

Installation

To obtain the workshop materials, install the learndrake package, TensorFlow, and Keras.

install.packages("remotes")
remotes::install_github("wlandau/learndrake")
keras::install_keras()
# Check if the installation succeeded.
tensorflow::tf_config()

If you are using RStudio version 1.2.5003 and encounter this fatal error, consider downgrading TensorFlow to version 1.13.1. Note: install_keras() silently tries to upgrade TensorFlow to version >= 2, so you will need to run it with tensorflow = "1.13.1.

Usage

RStudio Cloud (pre-built)

  1. Sign up for RStudio Cloud.
  2. Navigate to https://rstudio.cloud/project/627076 to open a new copy of the workshop.
  3. Optional: save a permanent copy so you can come back to it later. Look for the red “temporary copy” text at the top and click the “save a permanent copy” option next to it.

RStudio Cloud (custom)

This approach takes a bit longer to set up than the pre-built project.

  1. Sign up for RStudio Cloud.
  2. Create a fresh new project.
  3. Run this setup script to install the dependencies and download the materials.

Binder

Just click this badge: Launch RStudio Binder. Your browser will open the materials in a free RStudio Server instance.

  • Advantage: no need to sign up for RStudio Cloud.
  • Disadvantage: long load times and quick timeouts.

Local

The functions in learndrake help navigate and deploy the workshop materials. If you installed the package and dependencies as above, you can take the workshop locally without an internet connection. Start with the introductory slides, then move on to the notebooks. Launch apps along the way as directed.

Function Purpose
launch_app() Launch a Shiny app that accompanies a tutorial.
save_app() Save the app files so you can deploy to shinyapps.io or Shiny Server.
save_notebooks() Save the tutorials to your computer: R notebooks and supporting files.
save_slides() Save the introductory slides to your computer.
view_slides() Open the introductory slides in a web browser.

Introductory presentation

The workshop begins with an introductory presentation on drake. You can find a video recording here. Alternatively, you can view the slides at https://wlandau.github.io/learndrake/index.html or open them yourself in a browser with view_slides().

commcall



Tutorials

After the introductory presentation, students work through a sequence of R notebooks in order. Use save_notebooks() to save the notebooks and supporting files to your computer.

Topic Notebook
Custom functions 1-functions/1-functions.Rmd
drake plans 2-plans/2-plans.Rmd
Changing workflows 3-changes/3-changes.Rmd
Static branching 4-static/4-static.Rmd
Dynamic branching 5-dynamic/5-dynamic.Rmd
Files and R Markdown 6-files/6-files.Rmd

Apps

Notebooks 3-changes.Rmd and 4-static.Rmd come with supporting Shiny apps to conduct the learning exercises. Use launch_app() to run any of these apps locally.

App Notebook
http://wlandau.shinyapps.io/learndrakechanges 3-changes/3-changes.Rmd
http://wlandau.shinyapps.io/learndrakestatic 4-static/4-static.Rmd
http://wlandau.shinyapps.io/drakeplanner 4-static/4-static.Rmd

Thanks

Thanks to For
Edgar Ruiz Uniting drake and keras at https://github.com/sol-eng/tensorflow-w-r and providing valuable advice on the construction of the workshop.
Matt Dancho Publishing the original blog post with the workshop’s underlying case study.
Eric Nantz Reviewing and providing feedback on this workshop.
You can’t perform that action at this time.