At the end of day for, and I am now sitting at a cool 68% completion of the first course in a series of three in the Machine Learning Specialization by Stanford University and today, the learning has revolved around logistic regression, which is by far the most commonly used algorithm for classification. I can also disclose that I had my first graded lab which I passed with 100% 🥳.
Classification is where you want your model to output not just any value, but a classification of the input. Lets say you want a model to predict wether or not an email is spam, that would be a classification problem, as you would want the output to be either 1 (yes, it is spam) or 0 (no, it is not spam). In other words, you want the model to either classify the input email as spam or as not spam. Utilizing linear regression for classification would cause a situation like in the image below, where the output is very unclear and the model will almost never be very accurate.
Instead, we utilize logistic regression, which uses a sigmoid function instead of the linear function, which is going to be much more accurate and easy to read. When doing logistic regression, you still use linear regression behind the scenes, but instead of using the output of the linear model, we process it like the following; 1 divided by 1 plus e to the power of -z where z is the output of the linear regression with the given inputs.