-
-
Save tsukanov-as/503c59d7c37f45bba8c77455b129dbbb to your computer and use it in GitHub Desktop.
Revisions
-
45deg revised this gist
Mar 3, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed. -
45deg revised this gist
Mar 3, 2018 . No changes.There are no files selected for viewing
-
45deg revised this gist
Mar 3, 2018 . No changes.There are no files selected for viewing
-
45deg created this gist
Mar 3, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ import numpy as np from numpy import pi # import matplotlib.pyplot as plt N = 400 theta = np.sqrt(np.random.rand(N))*2*pi # np.linspace(0,2*pi,100) r_a = 2*theta + pi data_a = np.array([np.cos(theta)*r_a, np.sin(theta)*r_a]).T x_a = data_a + np.random.randn(N,2) r_b = -2*theta - pi data_b = np.array([np.cos(theta)*r_b, np.sin(theta)*r_b]).T x_b = data_b + np.random.randn(N,2) res_a = np.append(x_a, np.zeros((N,1)), axis=1) res_b = np.append(x_b, np.ones((N,1)), axis=1) res = np.append(res_a, res_b, axis=0) np.random.shuffle(res) np.savetxt("result.csv", res, delimiter=",", header="x,y,label", comments="", fmt='%.5f') # plt.scatter(x_a[:,0],x_a[:,1]) # plt.scatter(x_b[:,0],x_b[:,1]) # plt.show()