Created
September 18, 2020 14:23
-
-
Save giuliano-macedo/45be30fb1edcc226022ba295219adc50 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
from sklearn.datasets import make_blobs | |
# import pandas as pd | |
import numpy as np | |
centers=[ | |
[.1,.1], | |
[.2,.1], | |
[.3,.1], | |
[.4,.1], | |
[.5,.1], | |
[.6,.1], | |
[.7,.1], | |
[.8,.1], | |
[.9,.1] | |
] | |
dataset=None | |
for chunk_time in range(20): | |
l=chunk_time//4 | |
u=5+chunk_time//4 | |
print("total,actual=",len(centers[:u]),len(centers[l:u])) | |
chunk,_=make_blobs( | |
n_samples=4000, | |
n_features=2, | |
centers=centers[l:u], | |
cluster_std=0.001, | |
center_box=(0,0), | |
random_state=42, | |
shuffle=True | |
) | |
dataset=chunk if dataset is None else np.concatenate((dataset,chunk)) | |
np.savetxt("synthetic.csv",dataset,delimiter=",",fmt="%f") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment