Created
February 10, 2019 15:27
-
-
Save abhishek-Kumar009/f9b234eceaf70a5da3061ad221ba971c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 estimateGaussian(X): | |
n = np.size(X, 1) | |
m = np.size(X, 0) | |
mu = np.zeros((n, 1)) | |
sigma2 = np.zeros((n, 1)) | |
mu = np.reshape((1/m)*np.sum(X, 0), (1, n)) | |
sigma2 = np.reshape((1/m)*np.sum(np.power((X - mu),2), 0),(1, n)) | |
return mu, sigma2 | |
mu, sigma2 = estimateGaussian(X) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment