Posts

Showing posts from August, 2020

Mathematics And Theory Behind The Magic of Logistic Regression

Image
Introduction Is that a bird? Is that a plane? Well, ask no more, we  have just got the algorithm which can classify the given input into a label or as we denote them as 0 or 1, 0 standing for a no and 1 for yes and it is called logistic regression. But why Logistic Regression? In previous blog I shared a basic idea about linear regression and while linear regression can be a great tool for linearly related data but when it comes to classification it is not quite useful because we need to come up with a non linear way to give our result and logistic regression is just about it. Where do we want to use logistic regression? The area of logistic regression is classification. By looking at the entrance marks of a student we can classify whether s/he may get selected or not, by looking at the size of tumor we can classify whether it is malignant or not. The possibilities are endless but lets look at why will linear regression fail to converge in such data set. The line y = mx+b is not the be

Mathematics And Theory Behind The Magic of Linear Regression

Image
Introduction  "Machine learning is the new electricity", is something which we have heard once in our lifetime. From the use of photos app to social media  there is some use of it in almost every aspect of our day to day life. Today lets look at one of the basic machine learning algorithm which almost anyone can learn and use to predict new outcomes of linear data. Before moving on to the actual algorithm lets give a quick look at high school maths which many of us may remember.  The equation of a straight line : Y = mx +b  The distance between two points(x 1 ,y 1 and x 2 ,y 2 )  = √(x 2 -x 1 ) 2 +(y 2 -y 1 ) 2 What is Linear Regression? Linear regression is a regression algorithm to find a best fitting line to the given linearly related data-set. Such data set could be the house price with house features or could be as simple as the marks obtained by a student per hours they invest in their studies. Lets visualize a data set where we plot the students marks with the num