Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TestGist
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
You can’t perform that action at this time.