0
0
NumPydata~5 mins

Correlation coefficient with np.corrcoef() in NumPy - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
A-1 to 1
B0 to 1
C-100 to 100
D0 to infinity
What does np.corrcoef(x, y) return when x and y are 1D arrays?
AA list of correlation values
BA single correlation value
CA 2x2 matrix of correlation coefficients
DAn error
If the correlation coefficient between two variables is close to 0, what does it mean?
ANo linear relationship
BStrong positive relationship
CStrong negative relationship
DPerfect correlation
Which numpy function is used to calculate correlation coefficients?
Anp.cov()
Bnp.corrcoef()
Cnp.mean()
Dnp.std()
What does a correlation coefficient of -1 indicate?
ARandom relationship
BNo relationship
CPerfect positive linear relationship
DPerfect 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.