Recall & Review
beginner
What does the correlation coefficient measure?
It measures the strength and direction of a linear relationship between two variables, ranging from -1 (perfect negative) to 1 (perfect positive).
Click to reveal answer
beginner
What is the purpose of
np.corrcoef() in numpy?It calculates the correlation coefficient matrix between input arrays, showing how variables relate linearly.
Click to reveal answer
beginner
How do you interpret a correlation coefficient of 0?
It means there is no linear relationship between the two variables, but they might still have other types of relationships.
Click to reveal answer
intermediate
What shape of output does
np.corrcoef() return when given two 1D arrays?It returns a 2x2 matrix where diagonal elements are 1 (correlation of each variable with itself) and off-diagonal elements are the correlation coefficients between the two variables.
Click to reveal answer
intermediate
Why is it important to check correlation before building a predictive model?
Because strong correlations can indicate important relationships between variables, helping to select features and understand data patterns.
Click to reveal answer
What is the range of values for the correlation coefficient?
✗ Incorrect
The correlation coefficient ranges from -1 (perfect negative) to 1 (perfect positive).
What does
np.corrcoef(x, y) return when x and y are 1D arrays?✗ Incorrect
It returns a 2x2 matrix showing correlations between x and y and themselves.
If the correlation coefficient between two variables is close to 0, what does it mean?
✗ Incorrect
A value near 0 means no linear relationship between variables.
Which numpy function is used to calculate correlation coefficients?
✗ Incorrect
np.corrcoef() calculates correlation coefficients.What does a correlation coefficient of -1 indicate?
✗ Incorrect
A value of -1 means a perfect negative linear relationship.
Explain how to use
np.corrcoef() to find the correlation between two data arrays.Think about what the matrix elements represent.
You got /4 concepts.
Describe what the correlation coefficient tells us about the relationship between two variables.
Consider how close the value is to 1 or -1.
You got /4 concepts.