/logistic_regression-cs109_2015

This is a case study on logistic regression adapted from CS109-2015. In this notebook we will show the math behind LR and focus on classification problems where this model can be used effectively.

Primary LanguageJupyter Notebook

Logistic Regression Case Study (CS109_2015)

python jupyter

400

Image taken from this source. A great Medium article on Logistic Regression byt the way.

This case study delves into the math behind logistic regression in a Python environment. We've adapted this case study from Lab 5 in the CS109 course. Please feel free to check out the original lab, both for more exercises, as well as solutions.

In this notebook, we turn our attention to classification. Classification tries to predict, which of a small set of classes, an observation belongs to. Mathematically, the aim is to find $y$, a label based on knowing a feature vector $\x$. For instance, consider predicting sex from seeing a person's face, something we do fairly well as humans. To have a machine do this well, we would typically feed the machine a bunch of images of people which have been labelled "male" or "female" (the training set), and have it learn the sex of the person in the image from the labels and the features used to determine sex. Then, given a new photo, the trained algorithm returns us the sex of the person in the photo.