
Python Machine Learning By Example
By :

The first regression model that comes to mind is linear regression. Does this mean fitting data points using a linear function, as its name implies? Let’s explore it.
In simple terms, linear regression tries to fit as many of the data points as possible, with a straight line in two-dimensional space or a plane in three-dimensional space. It explores the linear relationship between observations and targets, and the relationship is represented in a linear equation or weighted sum function. Given a data sample x with n features, x1, x2, …, xn (x represents a feature vector and x = (x1, x2, …, xn)), and weights (also called coefficients) of the linear regression model w (w represents a vector (w1, w2, …, wn)), the target y is expressed as follows:
Also, sometimes the linear regression model comes with an intercept (also called bias), w0, so the preceding linear relationship...