Created
August 26, 2018 12:50
-
-
Save hadrienj/aed685310da6a8b3ea154584b3653236 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calculateCovariance(X): | |
meanX = np.mean(X, axis = 0) | |
lenX = X.shape[0] | |
X = X - meanX | |
covariance = X.T.dot(X)/lenX | |
return covariance |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment