# Confusion regarding least squares method

I am having some confusion regarding least squares method. Actually, least squares method is for minimizing the square of the $L_2$ norm of $Ax-b$ as given in this video lecture. However I am confused if we are given a set of points like $(x_1,y_1),(x_2,y_2)...(x_4,y_4)$. Then our model is something like

$$y=ax+b$$ where we have to find the parameters and b. So we need to minimize the square of the $L_2$ norm of

$$(y-ax-b)$$

isn't it?

-
Minimizing $(Ax-b)^2$ is wrong; minimizing $(y-(Ax+b))^2$ is right.