library(MASS)
library(class)
library(ISLR)
library(tidyverse)
Supervised learning: classification
Introduction
In this practical, we will learn to use three different classification methods: K-nearest neighbours, logistic regression, and linear discriminant analysis.
One of the packages we are going to use is class
. For this, you will probably need to install.packages("class")
before running the library()
functions.
Make sure to load MASS
before tidyverse
otherwise the function MASS::select()
will overwrite dplyr::select()
Default dataset
The default dataset contains credit card loan data for 10 000 people. The goal is to classify credit card cases as yes
or no
based on whether they will default on their loan.