When predicting employee salaries using multiple variables like years of education, linear regression requires fitting a plane instead of a straight line by adding additional variables to the equation. To find the optimal solution, we minimize the average squared error between predicted and actual salaries. The gradient descent algorithm achieves this by starting at a random point and iteratively moving in the direction of the negative gradient (the vector of partial derivatives) to decrease the error function most rapidly.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Visualize Linear Regression in 3DAdded:
Let's revisit our example of employee salaries. Obviously, in the real world, salaries depend on many other factors.
For example, we can consider the number of years of formal education. To account for this extra dimension, instead of fitting a straight line, we will fit a plane. What this means for our equation is that we must add another variable.
Now to solve linear regression we need to minimize the average squared error.
Remember that each error is the difference between the predicted salary and the actual one. We take the average across all data points. By the way, you have probably noticed that we are back to the one-dimensional case. This is because it lends itself better to visualization.
To find the minimum of this function, you can use the algorithm called gradient descent. The idea is simple.
You start at a random point and then you keep moving in the direction that decreases the function the fastest. This direction is given by the negative of the gradient which is a vector of all partial derivatives of the function.
Related Videos
Olympiad Mathematics | Indian | Can You Solve This One?
PhilCoolMath
650 views•2026-06-03
Escaping the Fog
LogicLemurGaming
760 views•2026-06-03
A Brutal Radical Expression Made Easy! The Shortcut Changes Everything.
tamoshop
112 views•2026-06-02
V : jee main /advance class 11 mathematics : Binomial Theorem class-1 ( 29 may 2026 )
dcamclassesiitjeemainsadva9953
125 views•2026-05-29
Is This Pentomino Tileable?
3cycle
241 views•2026-05-30
This Sudoku Has Many Lines!!
CrackingTheCryptic
2K views•2026-05-29
Olympiad Mathematics | Indian Can You Solve This One?
PhilCoolMath
268 views•2026-06-02
Olympiad Mathematics | Indian | Can You Solve This?
PhilCoolMath
669 views•2026-06-02











