7/6/2018

Non-linear logistic regression

  • Logistic regression is estimating the parameters of a logistic model. More formally, a logistic model is one where the log-odds of the probability of an event is a linear combination of independent or predictor variables. The two possible dependent variable values are often labelled as "0" and "1", which represent outcomes such as pass/fail, win/lose, alive/dead or healthy/sick.

  • The binary logistic regression model can not only be generalized a linear model (visualized as a line) but also a non-linear model by adding more higher-ordered term

The reason I choose it

This is a part of an assigment in Andrew Ng's Machine Learning course on Coursera. It requires me to implement logistic regression in Octave / Matlab. But in this Shiny application, I reimplement it in R.

Specifically, I implement logistic regression and the visualization of the decision boundaries.

How to interact

We can interactive the plot by changing Degree Polynomial to fit a higher-ordered model into the training data. In other word, this increment makes the model become high variance.

Because of that, we use L2 regularisation to weight/penalise residuals when the parameters of the logistic regression model being learnt. By tuning the value Lambda, we can generalize better because it is less sensitive to extreme variance in the data such as outliers.

A snapshot