Logistic Regression Lab
Learn to code logistic regression in this lab.
Goal
In this lab, we’ll again, try to predict players’ skill level, i.e., the SkillLevel
column, which takes integer values between 0
and 3
, with 0
being novice and 3
being expert. As we have more than two values for the class variable SkillLevel
, we’ll apply multinomial logistic regression, that is, logistic regression for more than two class values, instead of the vanilla version that only deals with binary classification cases. We’ll use the logistic regression implementation in the nnet
package, since the one in the caret
package isn’t as robust.
Brief refresher
Similar to Naive Bayes, Logistic regression estimates class probabilities, instead of directly predicting the class like KNN. Logistic regression assumes that the probabilities can be approximated by passing a linear combination of independent variables’ values through a logistic function. You can therefore see where the linear assumption and the logistic part of its name comes from.
Preparation
Though we will not use the caret
package for the logistic regression model, we'll still import it to leverage the preprocessing capabilities.
Get hands-on with 1400+ tech skills courses.