| ... | ... | @@ -108,6 +108,26 @@ At this stage, the model is not trained at all. What happens as we see examples? |
|
|
|
|
|
|
|
<img src="uploads/47f290dd30648b9cf47e1c597fc45a11/br2.png" width="600">
|
|
|
|
|
|
|
|
Samples of models withdrawn from the posterior distribution is given on the right. Here we see that the lines start to accumulate around the observation already.
|
|
|
|
|
|
|
|
In the next step, we pass another observation. The likelihood function for the second observation is given on the left. This is then multiplied with the current prior (previously calculated posterior) and normalized, giving the new posterior distribution in the middle:
|
|
|
|
|
|
|
|
<img src="uploads/4ba75e6723c829adb282c02d3fd9e97f2/br3.png" width="600">
|
|
|
|
|
|
|
|
If we sample from this new posterior, it gives us the sample lines on the right. We can see that the probable options for the model parameters are narrowed down (middle), which gives much more converged lines.
|
|
|
|
|
|
|
|
If we do the same 20 times, we see that the model training is almost complete:
|
|
|
|
|
|
|
|
<img src="uploads/f4ef85b77055e49a552694f4f50a4274/br4.png" width="600">
|
|
|
|
|
|
|
|
We have narrowed down the weight options, giving the model more confidence in the predictions. The predicted weight range is very close to the true value (shown as +).
|
|
|
|
|
|
|
|
What is nice about Bayesian interpretation is that with this sampling, we can generate a variance in predictions, so that we can talk about confidence in model predictions.
|
|
|
|
|
|
|
|
If you want to understand the calculation of likelihood and posteriors better, I suggest you to work on this [demo](https://seeing-theory.brown.edu/bayesian-inference/index.html#section1) and perform the calculations by hand.
|
|
|
|
|
|
|
|
If you want to see how the above plots are generated, you may visit [this blog page](https://maxhalford.github.io/blog/bayesian-linear-regression/). Please note that the above base plots are scanned from an example given in ["Pattern Recognition and Machine Learning" book, Chapter 3](Recommended-resources-and-books#recommended-books).
|
|
|
|
|
|
|
|
## Additional Sources
|
|
|
|
|
|
|
|
Explore the additional resources for more!
|
| ... | ... | |
| ... | ... | |