Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
mean_vec = np.mean(X_std, axis=0)
cov_mat = (X_std - mean_vec).T.dot((X_std - mean_vec)) / (X_std.shape[0]-1)
print('Covariance matrix \n{}'.format(cov_mat))
print('Covariance matrix shape is: {}'.format(cov_mat.shape))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment