參考:https://scikit-learn.org/dev/modules/generated/sklearn.datasets.make_blobs.html
函數原型:sklearn.datasets.
make_blobs
(n_samples=100, n_features=2, centers=None, cluster_std=1.0, center_box=(-10.0, 10.0), shuffle=True, random_state=None)
參數解釋:n_samples(int/array):如果參數為int,代表總樣本數;如果參數為array-like,數組中的每個數代表每一簇的樣本數。
n_features(int):樣本點的維度。
centers(int):樣本中心數。如果樣本數為int且centers=None,生成三個樣本中心;如果樣本數(n_samples)為數組,則centers 要么為None,要么為數組的長度。
cluster_std(float/sequence of floats):樣本中,簇的標准差。
center_box(pair of floats (min, max)):每個簇的上下限。
shuffle(boolean):是否將樣本打亂。
random_state(int/RandomState instance /None):指定隨機數種子,每個種子生成的序列相同,與minecraft地圖種子同理。
返回類型:X : 樣本數組 [n_samples, n_features]
產生的樣本
y : array of shape [n_samples]
每個簇的標簽
example: