Last updated 2024-08-06.
This Github repo contains all lesson files for Machine Learning in R.
The goal is to impart students with the basic tools to construct,
evaluate and compare various machine learning models, using
caret
. (Materials developed with
Yael Bar-Shachar.)
These topics were taught in the graduate-level course Machine Learning for Psychologists (Psych Dep., Ben-Gurion University of the Negev; Psych Dep., Tel-Aviv University). This course assumes basic competence in R (importing, regression modeling, plotting, etc.), along the lines of Practical Applications in R for Psychologists.
Notes:
- This repo contains only materials relating to Practical Applications in R, and does not contain any theoretical or introductory materials.
- Please note that some code does not work on purpose, to force students to learn to debug.
You will need:
- A fresh installation of
R
(preferably version 4.2 or above). - RStudio IDE (optional, but recommended).
- The following packages, listed by lesson:
You can install all the packages used by running:
# in alphabetical order:
pkgs <- c(
"caret", "datawizard", "dplyr", "factoextra", "forcats", "ggplot2",
"ggrepel", "GPArotation", "ISLR", "kernelshap", "leaps", "lime",
"MASS", "nFactors", "parameters", "performance", "psych", "recipes",
"rsample", "Rtsne", "scales", "shapviz", "tidyr", "tidyverse", "yardstick"
)
install.packages(pkgs, dependencies = TRUE)
Package Versions
The package versions used here:
caret
6.0-94 (CRAN)datawizard
0.11.0 (CRAN)dplyr
1.1.4 (CRAN)factoextra
1.0.7 (CRAN)forcats
1.0.0 (CRAN)ggplot2
3.5.1 (CRAN)ggrepel
0.9.5 (CRAN)GPArotation
2024.3-1 (CRAN)ISLR
1.4 (CRAN)kernelshap
0.4.1 (CRAN)leaps
3.1 (CRAN)lime
0.5.3 (CRAN)MASS
7.3-60.0.1 (CRAN)nFactors
2.4.1.1 (CRAN)parameters
0.22.0 (CRAN)performance
0.12.0 (CRAN)psych
2.4.3 (CRAN)recipes
1.0.10 (CRAN)rsample
1.2.1 (CRAN)Rtsne
0.17 (CRAN)scales
1.3.0 (CRAN)shapviz
0.9.3 (CRAN)tidyr
1.3.1 (CRAN)tidyverse
2.0.0 (CRAN)yardstick
1.3.1 (CRAN)