Correlation activity

So get your hands dirty, roll up your sleeves, I want you to use the numpy.cov() function. That's actually a way to get NumPy to compute covariance for you. We saw how to compute correlation using the corrcoef() function. So go back and rerun these examples just using the numpy.cov() function and see if you get the same results or not. It should be pretty darn close, so instead of doing it the hard way with the covariance function that I wrote from scratch, just use NumPy and see if you can get the same results. Again, the point of this exercise is to get you familiar with using NumPy and applying it to actual data. So have at it, see where you get.

And there you have it, covariance and correlation both in theory and in practice. A very useful technique to have, so definitely remember this section. Let's move on.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.11.211