The targets
R package is the long-term successor of drake
, and it is more robust and easier to use. Please visit https://books.ropensci.org/targets/drake.html for full context and advice on transitioning. A short course on targets
is available at https://github.com/wlandau/targets-tutorial.
learndrake
is a free online short course on the drake
R
package. With guided web-based
hands-on exercises, you will gradually build up a
drake
-powered machine learning
project
and practice the fundamentals of
drake
. If you run into trouble or
have questions along the way, please post an issue at
https://github.com/wlandau/learndrake to ask for help.
- Read the intro slides at https://wlandau.github.io/learndrake and watch the video recording at https://ropensci.org/commcalls/2019-09-24.
- Sign up for a free RStudio Cloud account at https://rstudio.cloud.
- Log into the public RStudio Cloud workspace at https://rstudio.cloud/project/627076. You are now running an instance of RStudio Server with everything you need.
- In the “Files” pane of the IDE, locate the numbered folders with
*.Rmd
notebooks inside. Work through the notebooks in order.
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 |
Notebooks 3-changes/3-changes.Rmd
and 4-static/4-static.Rmd
rely on
the following Shiny apps.
App | Notebook |
---|---|
https://colorado.rstudio.com/rsc/learndrake/changes/ | 3-changes/3-changes.Rmd |
https://colorado.rstudio.com/rsc/learndrake/static/ | 4-static/4-static.Rmd |
https://colorado.rstudio.com/rsc/learndrake/planner/ | 4-static/4-static.Rmd |
The learndrake
R package
contains the materials of the short course. It helps students take the
workshop locally if they so choose, and it helps educators and
administrators host the workshop from alternative platforms.
You can install learndrake
from GitHub.
install.packages("remotes")
remotes::install_github("wlandau/learndrake")
To run the exercises locally, you will also need TensorFlow and Keras.
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
.
The functions in learndrake
deploy and serve the course materials.
Function | Purpose |
---|---|
save_notebooks() |
Save the *.Rmd notebooks to your computer. |
view_slides() |
Open the intro slides in a web browser. |
save_slides() |
Save the intro slides to your computer. |
launch_app() |
Launch a supporting Shiny app. |
save_app() |
Save the code files of a supporting Shiny app. |
This short course focuses mostly on drake
’s mental model and core
concepts.
- How to break up a project into functions.
- How to think about and create
drake
plans. - How
drake
decides what is up to date and what is outdated.
The following resources cover important topics that did not make it into the syllabus.
- Miles McBain’s excellent blog post explains the motivating factors and practical issues {drake} addresses for most projects, how to set up a project as quickly and painlessly as possible, and how to overcome common obstacles.
- Miles’
dflow
package generates the file structure for a boilerplatedrake
project. It is a more thorough alternative todrake::use_drake()
. drake
is heavily function-oriented by design, and Miles’fnmate
package automatically generates boilerplate code and docstrings for functions you mention indrake
plans.
- The official manual has a
chapter on
drake
’s high-performance computing capabilities, which range from multicore computing on a local machine to large-scale deployment to a cluster.
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 course. |
Matt Dancho | Publishing the original blog post with the course’s underlying case study. |
Eric Nantz | Reviewing the materials and providing feedback. |