Home Artificial Intelligence Linear Regression without iteration (Mathematical Intuition)

Linear Regression without iteration (Mathematical Intuition)

2
Linear Regression without iteration (Mathematical Intuition)

Let’s understand the issue statement before diving into the actual concept

Each regression problem is given X and Y values, and after training with a specific algorithm, it predicts the Y(i) based on the X(i). For instance, let’s assume X = [1,2,3,4] and Y = [1,2,3,4], Thus, Y is similar as X. If X(i) equals 5, then Y(i) equals 5.

To ascertain a generalized formula for the above example, let’s consider the road equation as Y = mX + c ( m: slope, c: Y-intercept), as we already concluded that Y is similar because the X thus equation becomes Y = X (Where m = 1 and c = 0).

Allow us to now take a look at the mathematical intuition of linear regression. Let’s consider the identical example as before, where X = [1,2,3,4] and Y = [1,2,3,4]. Here we want to derive Y = X (m = 1 and c = 0), so the major concern here is to search out out the the m and c values.

To derive the “m” and “c” values, we are going to make use of the price function. i.e,

Here, n = variety of entries, and y = mx + c, Then we take the partial derivative of the price function w.r.t. “m” and “c” and equate them to zero such that it ends in two equations and two unknowns. Further, this will easily be solved to search out the m and c values.

To seek out m,

To seek out c,

In consequence of substituting m = 1 and c = 0 in the road equation, we get y = 1(x) + 0, Y = X.//

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here