Module 1: Supervised machine learning
- Highest value machine learning algorithms
- Random forest
- Boosting
- Performance evaluation (discrimination, calibration, net benefit)
- Interpretability (SHAP global and local variable importance, ALE plots)
- Averaging multiple prediction algorithms (ensembling)
- Choosing algorithm settings (hyperparameter optimization)
- Automated machine learning (tidymodels + h2o)
- Active calibration: logistic, isotonic, beta, GAM - see tidymodels tutorial.
- Coding challenge / questions / break / troubleshooting (30 minutes)
Module 2: Generative AI
See genai-outline.md.
First, go through the major installation items in setup.md.
Then download the repository, open it in Positron as a folder (or RStudio), then run:
renv::restore()
This will install the necessary R packages for module 1.
If you run into errors (e.g. installing xgboost), copy the error message, open the Cline extension in Positron, and chat with the LLM to see if you can resolve the issue. Make sure you give it the full error message, what you're doing, and your operating system (Windows or Mac).
As a backup option, you can also run this workshop in a GitHub codespace (see below).
To run Module 1 using RStudio on GitHub Codespaces, click the green "Code" button -> then "Codespaces" tab -> create "codespace on main". Once that starts up, click to the ports tab and click the globe to open a remote RStudio session.
Once logged in to Rstudio (username: rstudio, password: rstudio), click to the Terminal tab, cd to your home directory, and create a symlink to the working data
ln -s /workspaces/hands-on-ai-in-psychiatry .
Then run the renv::restore() command above to install the packages.
These books provide a thorough foundation for the material we briefly touch on in this workshop. Feel free to pick and choose the chapters that interest you the most - you don't need to read every chapter.
And remember that you can use Cline, Claude Code, or other LLMs to do most of the coding and minimize the struggle. (But if really want to understand what's going on, you'll want to write some of the code - that can come later though).
Hands-On Machine Learning with R by Brad Boehmke and Brandon Greenwell. (2020). CRC Press.
Deep Learning with Python, 3rd Edition by François Chollet. (2025). Manning.
Hands-on Large Language Models: Language Understanding and Generation by Jay Alammar and Maarten Grootendorst. (2024). O'Reilly.
Hands-On Generative AI with Transformers and Diffusion Models by Omar Sanseviero et al. (2024). O'Reilly.
Note: beware of AI-related books by Packt Publishing, as they are often of low quality. Publishers like CRC, O'Reilly, and Manning maintain important quality standards.
Liu, Y., Chen, P. H. C., Krause, J., & Peng, L. (2019). How to read articles that use machine learning: users’ guides to the medical literature. Jama, 322(18), 1806-1816.
Ning, Y. et al. (2024). Generative artificial intelligence and ethical considerations in health care: a scoping review and ethics checklist. The Lancet Digital Health, 6(11), e848-e856. See GitHub repo
Schlagwein, D., & Willcocks, L. (2023). ‘ChatGPT et al.’: The ethics of using (generative) artificial intelligence in research and science. Journal of Information Technology, 38(3), 232-238.