Recall & Review
beginner
What does the
np.cov() function calculate?It calculates the covariance matrix, which shows how two or more variables change together.
Click to reveal answer
beginner
What is covariance in simple terms?
Covariance measures if two variables increase or decrease together. Positive means they move together, negative means opposite.
Click to reveal answer
intermediate
How do you interpret a covariance matrix output from
np.cov()?The diagonal shows variance of each variable. Off-diagonal values show covariance between pairs of variables.
Click to reveal answer
intermediate
What does setting
rowvar=False in np.cov() do?It tells
np.cov() that each column represents a variable, and rows are observations.Click to reveal answer
beginner
Why is covariance important in data science?
It helps understand relationships between variables, which is key for analysis and building models.
Click to reveal answer
What does a positive covariance between two variables indicate?
✗ Incorrect
Positive covariance means both variables tend to increase or decrease at the same time.
In
np.cov(), what does the default rowvar=True mean?✗ Incorrect
By default,
np.cov() treats each row as a variable and columns as observations.What shape is the output of
np.cov() when given two variables?✗ Incorrect
The covariance matrix for two variables is 2x2, showing variance and covariance.
Which numpy function is used to calculate covariance?
✗ Incorrect
np.cov() calculates covariance matrices.If covariance between two variables is zero, what does it mean?
✗ Incorrect
Zero covariance means no linear relationship between variables.
Explain what covariance is and how
np.cov() helps calculate it.Think about how two variables move together and how numpy shows this.
You got /4 concepts.
Describe how to use
np.cov() with a dataset where each column is a variable and each row is an observation.Remember the parameter that changes how variables are read.
You got /3 concepts.