Getting Set Up

Two ways to be ready: on your machine or on the RStudio Server.

Author

Thelma Panaïotis

This page walks you through getting ready for the tutorial. Two set-ups are possible: on your own machine (Set up locally), or on a pre-configured RStudio Server (Set up on the RStudio Server). Pick the one that suits you: both are detailed below.

1 Set up locally

The repository and its pinned environment will be shared ahead of the tutorial, so you can set everything up beforehand, at your own pace, and start the session with a working setup. The install takes a few minutes: it is best done before the session.

Clone the repo

git clone https://github.com/pyranhia/uros2026-shap-workshop.git

Run this in a terminal (or in the Terminal tab of RStudio, next to the Console). A new folder appears once cloning finishes.

Open the R project

Open the .Rproj file rather than a loose script, it sets up file paths and package management automatically.

In RStudio, use File > Open Project… and select the .Rproj file of the cloned folder.

TipHow do I know the project is open?

The project name appears top-right in RStudio (instead of Project: (None)).

Install the environment

Packages are pinned with renv, so everyone runs the exact same versions. In the R Console, run:

renv::restore()
NoteHow long does this take?

A few minutes the first time, so do it ahead of the session, on a good connection. You’ll know it’s done when you see:

* The library is already synchronized with the lockfile.

Reopening the project later won’t repeat this step unless something changed.

NoteDo I need datapyranhia?

No. datapyranhia, the package that holds the Adult dataset, is only needed to retrain the model with R/01_train_model.R, which is optional: the trained model and the data are already in the repository. If you want to retrain it, install the package first, from GitHub (it is not on CRAN):

install.packages("pak")
pak::pak("pyranhia/datapyranhia")
WarningIf renv::restore() errors out

It requires R and, depending on your platform, working build tools for compiling packages from source (in particular for lightgbm).

If you can’t sort it out quickly, don’t worry: you can use the RStudio Server instead (see below).

Launch the demo app

The tutorial uses a small Shiny app (app/shiny_demo/) to explore break-down and SHAP explanations interactively. Open app/shiny_demo/app.R in RStudio and click Run App. The precomputed SHAP values it needs (data/processed/shap_values.rds) are in the repository.

Test it before the session

Run the first lines of R/02_shap_exercises.R (the libraries and the model loading, before Part 0) and confirm it runs without error, then check that the app starts.

2 Set up on the RStudio Server

Connect to the server

A pre-configured RStudio Server is available during the tutorial. Nothing to install: the environment is fully controlled, every package is the right version and nothing depends on your machine. The usernames and passwords will be handed out at the start of the session.

Open a recent browser (Chrome, Firefox, Safari, or Edge) and go to: rstudio.pyranhia.eu

You’ll land on the RStudio Server sign-in page:

  • Username: the sea-animal-themed handle on the slip you’ll receive at the start of the session
  • Password: also on that slip

Click Sign In. You should see the RStudio interface: script editor (top left), R console (bottom left), environment (top right), files/plots (bottom right).

NoteIf the page won’t load

Most common causes, in order:

  • Active VPN: turn it off and try again.
  • Restrictive corporate/institutional network: try tethering from your phone instead.
  • Outdated browser: try a different, up-to-date one.

If it still doesn’t work, flag it at the start of the session and we’ll sort it out.

Open the R project

Your copy of the repository (uros2026-shap-workshop) is already in your home folder, with every package installed. As locally, open the project: File > Open Project…, then select uros2026-shap-workshop.Rproj (or click it in the Files tab, bottom right). Opening the project is what activates its renv environment: without it, the packages won’t be found.

Then, just in case, run renv::restore() in the R Console as you would locally: if everything is already in place it finishes in seconds and prints The library is already synchronized with the lockfile.

The demo app on the RStudio Server

WarningDon’t run the app on the RStudio Server

Don’t open app/shiny_demo/app.R with Run App here: use the dedicated instance, shiny-uros2026.pyranhia.eu.

NoteWhy a separate instance?

The demo app is mostly about displaying plots (light compute), while the RStudio Server sessions handle the actual SHAP computation exercises. Keeping the two apart isolates the load: if the demo app instance gets busy (for instance when I ask the whole room to click through the same tab together) it doesn’t affect anyone’s individual RStudio session, and vice versa.

3 You’re all set

Open R/02_shap_exercises.R from the Files tab whenever we get to the hands-on coding parts. Any question, technical or otherwise: just ask.

Let’s SHAP! 🚀