r/pythonhelp • u/Ipsoka • Nov 10 '19
Not understanding numpy.random
Hey guys,
I really cant get my head around what is happening in this Code. What is numpy.random.multivariate_normal returning. What is x and what is y. And what are those red lines representing. Would be nice if someone could explain like im five. I really dont understand what those samples represent
Note: I am the one who wrote the code, it was an excersice I had to do where I basically just followed what the lection told me to do. Here is the excersice
1
u/someoneonboard1 Nov 11 '19
Did you go through this numpy documentation? It pretty much explains everything. There is even one example just like the one you have in your Code.
https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.random.multivariate_normal.html
1
u/Best_Caterpillar Nov 11 '19
do you know what the normal distribution is? the x and y are literal x and y pairs from that sample. the red line is the relationship using the b0 and b1 coeficents that you got in the biddle of your code
side note, it really doesnt help you to overload the variables like you did, cause halfway through you change the meaning and that is not helping your comprehension any