Model Pipeline - Correlation analysis
Correlation analysis finds how two or more features in data move together. It helps us understand relationships before building models.
Correlation analysis finds how two or more features in data move together. It helps us understand relationships before building models.
N/A
| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | N/A | N/A | Correlation analysis does not involve training, so no loss or accuracy. |
x and y using NumPy?np.corrcoef() to compute correlation matrix.x and y is at position [0, 1] in the matrix.import numpy as np
x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]
correlation = np.corrcoef(x, y)[0, 1]
print("{:.2f}".format(round(correlation, 2)))y is exactly twice x, so they have a perfect positive linear relationship.import numpy as np x = [1, 2, 3] y = [4, 5] correlation = np.corrcoef(x, y)[0, 1] print(correlation)
x and y have lengths 3 and 2, which must be equal for correlation.hours_studied and exam_score. You calculate their correlation and get -0.85. What does this imply and what should you consider next?Pass the test and this pattern moves unknown