Understanding probabilistic view of linear regression I am trying to get into some machine learning and am not very good at math.
Could someone please help me with the following queston?
I am reading this script that explains the basic ideas behind probabilistic ML:
https://www.cl.cam.ac.uk/teaching/1617/MLBayInfer/mlbi-1.pdf
On page 41, the author explains how he generated the data for the linear regression examples and tries to show, I think, how this can be viewed as a probabilistic process.
I quite simply don't understand how steps 2 and 3 give you $p(y_i|\vec{x_i},\vec{w})$
It says:
For the ith example:

*

*I sampled $x_i$ according to the uniform density on [0, 3]. So there is a distribution
$p(\vec{x})$.

*I computed the value $h_{\vec{w}}(\vec{x}_i)$.

*I sampled $\epsilon_i ∼ N (0, σ^2)$ with $σ^2 = 0.1$ and formed $y_i = h_{\vec{w}}(\vec{x}_i)+\epsilon_i$
And therfore $p(y_i|\vec{x_i},\vec{w}) = N(h_{\vec{w}}(\vec{x}_i), \sigma^2)$
I kinda understand that the rgression line is the expected value of the normal distribution at that point... but I don't quite understand how the normal distribution arises from steps 2 and 3.
EDIT
Thanks for the comments.
I'll definitely check out the book and youtube videos.
I think mhdadk's comment touches on where I have difficulties.
So okay, If I add a constant k to a normal distribution $N(0,1)$, it becomes $N(k,1)$.
But how exactly is $y_i = h_{\vec{w}}(\vec{x}_i)+\epsilon_i$ the cond. distribution of $y$ given $x$ and $w$?  In this scenario, both $x$ and $e$ are random variables, right?
When I see a conditional distribution $P(A|B,C)$, I think of $\frac{P(A,B,C)} {P(B,C)}$
So does that mean that $N(h_{\vec{w}}(\vec{x}_i), \sigma^2)$ is somehow the result of $\frac{P(y,x,w)}{P(x,w)}$ ?

Usually, we tend to think about linear regression as outputting a single number, that is (hopefully) close to the real label. The optimization process try to make these single number predictions as close as possible to the true values (labels).
Here the author suggests a different view. Instead of a single number, the output is modeled by a normal distribution. The "regular" output of the linear regression $h(w, x_i)$ will be now the mean of the normal distribution, but we also have noise around it. In this specific example the $\sigma$ is constant, but you can think about cases in which each example will have its own $\sigma_i$.
The author created a dataset, in which each example is normally distributed, with mean of the output of the linear regression and variance of $\sigma^2$.
The way he did it is by generating a normal distributed number $\epsilon_i$ and add it to the linear regression output, $h(w, x_i)$. The addition of normally distributed random variable to a constant is also normally distributed variable.
Once we have a distribution (probabilistic view) we can ask how probable a value $y_i$ given the current linear regression weight and features $x_i$.
This can also be our loss function. If the value has high probability (i.e. it is close to the mean, which is linear regression output) we will have low loss because this value is probable under our model.
