Created
August 4, 2019 13:21
-
-
Save paulegradie/a4c41e763822d73f1c2a1eb46f6712f9 to your computer and use it in GitHub Desktop.
TestGist
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
import numpy as np | |
def make_blob_part(mean, cov, num_points=500): | |
x, y = np.random.multivariate_normal(mean, cov, num_points).T | |
return np.hstack((x.reshape(-1, 1), y.reshape(-1, 1))) | |
mean1 = [-10, 10] | |
mean2 = [-15, 5] | |
mean3 = [-9, 3] | |
cov1 = [[4, 0], [0, 3]] # diagonal covariance | |
cov2 = [[2, 0], [0, 3]] # diagonal covariance | |
cov3 = [[2, 0], [0, 3]] # diagonal covariance | |
params = zip([mean1, mean2, mean3], [cov1, cov2, cov3]) | |
blob = np.vstack([make_blob(x, y) for x, y in params]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment