Skip to content

Instantly share code, notes, and snippets.

@gabriel19913
Created April 18, 2019 15:13
Show Gist options
  • Save gabriel19913/94c4bd0640758a2c07c3e659dd2d0253 to your computer and use it in GitHub Desktop.
Save gabriel19913/94c4bd0640758a2c07c3e659dd2d0253 to your computer and use it in GitHub Desktop.
C1 = np.random.multivariate_normal(np.array([5, 5]), np.array([[1, 0],[0, 1]]), 500)
C2 = np.random.multivariate_normal(np.array([0, 0]), np.array([[1, 0],[0, 1]]), 500)
data1 = pd.DataFrame({'X1':C1[:,0],'X2':C1[:,1]})
data1['Class'] = np.full((500, 1), 'C1')
data2 = pd.DataFrame({'X1':C2[:,0],'X2':C2[:,1]})
data1['Class'] = np.full((500, 1), 'C2')
data = pd.concat([data1, data2], sort=True)
ax = sns.scatterplot(x="X1", y="X2", data=data, hue='Class',)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment