Posts

Linear Regression

Image
LINEAR REGRESSION I ntroduction: Linear regression attempts to model the relationship between the independent variables and a dependent variable by fitting a linear equation to the observed data. From a machine learning context, it is the simplest model one can try out on your data. If you have a hunch that the data follows a straight-line trend, linear regression can give you quick and reasonably accurate results.     Let's consider regression with 1 independent variable and 1 dependent variable, as shown in the plot  below. The  blue points below represent the data we have, while the red  line  is the line of best fit or the regression line.   Notation: Keep in mind that for regression, we need to have  labelled data,  i.e. we need all the independent variables' and the dependent variable's values to be given. Consider a simple regression case in which we are trying to predict the price of a house from multiple features such as size, numbe