Skip to content

mattansb/Machine-Learning-foR-Psychologists

Repository files navigation

Machine Learning foR Psychologists


Last updated 2023-12-30.

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.

Setup

You will need:

  1. A fresh installation of R (preferably version 4.2 or above).
  2. RStudio IDE (optional, but recommended).
  3. The following packages, listed by lesson:
Lesson Packages
01 Intro with Regression caret, ISLR, rsample, recipes, yardstick
02 Classification and Tuning dplyr, ISLR, caret, rsample, yardstick, recipes, ggplot2, psych
03 The problem of over-dimensionality dplyr, ggplot2, ISLR, caret, rsample, yardstick, recipes, leaps, tidyr, MASS
04 SVM ggplot2, rsample, recipes, caret, yardstick, forcats
05 Trees dplyr, rsample, recipes, caret, yardstick
06 unsupervised learning tidyverse, recipes, psych, parameters, factoextra, performance, nFactors, GPArotation, Rtsne, datawizard
07 explain predictions recipes, caret, yardstick, lime, kernelshap, shapviz, tidyr, forcats

You can install all the packages used by running:

# in alphabetical order:

pkgs <- c(
  "caret", "datawizard", "dplyr", "factoextra", "forcats", "ggplot2",
  "GPArotation", "ISLR", "kernelshap", "leaps", "lime", "MASS",
  "nFactors", "parameters", "performance", "psych", "recipes",
  "rsample", "Rtsne", "shapviz", "tidyr", "tidyverse", "yardstick"
)

install.packages(pkgs, dependencies = TRUE)
Package Versions

The package versions used here:

  • caret 6.0-94 (CRAN)
  • datawizard 0.9.1 (CRAN)
  • dplyr 1.1.4 (CRAN)
  • factoextra 1.0.7 (CRAN)
  • forcats 1.0.0 (CRAN)
  • ggplot2 3.4.4 (CRAN)
  • GPArotation 2023.11-1 (CRAN)
  • ISLR 1.4 (CRAN)
  • kernelshap 0.4.1 (CRAN)
  • leaps 3.1 (CRAN)
  • lime 0.5.3 (CRAN)
  • MASS 7.3-60 (CRAN)
  • nFactors 2.4.1.1 (CRAN)
  • parameters 0.21.3 (CRAN)
  • performance 0.10.8 (CRAN)
  • psych 2.3.12 (CRAN)
  • recipes 1.0.9 (CRAN)
  • rsample 1.2.0 (CRAN)
  • Rtsne 0.17 (CRAN)
  • shapviz 0.9.2 (CRAN)
  • tidyr 1.3.0 (CRAN)
  • tidyverse 2.0.0 (CRAN)
  • yardstick 1.2.0 (CRAN)

About

Lesson files used in the Machine Learning foR Psychologists

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages