用法:
dask_ml.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, chunks=None)
生成用於聚類的各向同性高斯斑點。
這可用於在機器集群上生成非常大的 Dask 數組。在分布式模式下使用 Dask 時,客戶端機器隻需要分配單個塊的數據。
- n_samples:int 或array-like,可選(默認=100)
如果是 int,則它是在集群之間平均分配的點的總數。如果array-like,則序列的每個元素表示每個簇的樣本數。
- n_features:int,可選(默認=2)
每個樣本的特征數。
- centers:int 或形狀數組 [n_centers, n_features],可選
(默認=無)要生成的中心數,或固定的中心位置。如果 n_samples 是一個 int 並且中心是 None,則生成 3 個中心。如果 n_samples 為 array-like,則中心必須為 None 或長度等於 n_samples 長度的數組。
- cluster_std:浮點數或浮點數序列,可選(默認=1.0)
聚類的標準差。
- center_box:一對浮點數(最小,最大),可選(默認=(-10.0,10.0))
隨機生成中心時每個聚類中心的邊界框。
- shuffle:布爾值,可選(默認 = True)
Shuffle[洗牌]樣本。
- random_state:int,RandomState 實例或無(默認)
確定數據集創建的隨機數生成。跨多個函數調用傳遞一個 int 以實現可重現的輸出。請參閱詞匯表。
- chunks:整數,元組
如何對數組進行分塊。必須是以下形式之一: - 像 1000 這樣的塊大小。 - 像 (1000, 1000) 這樣的塊狀。 - 沿所有維度的所有塊的顯式大小,例如
((1000, 1000, 500), (400, 400))。
- X:形狀數組 [n_samples, n_features]
生成的樣本。
- y:形狀數組 [n_samples]
每個樣本的集群成員的整數標簽。
參數:
返回:
例子:
>>> from dask_ml.datasets import make_blobs >>> X, y = make_blobs(n_samples=100000, chunks=10000) >>> X dask.array<..., shape=(100000, 2), dtype=float64, chunksize=(10000, 2)> >>> y dask.array<concatenate, shape=(100000,), dtype=int64, chunksize=(10000,)>
相關用法
- Python dask_ml.datasets.make_counts用法及代碼示例
- Python dask_ml.decomposition.PCA用法及代碼示例
- Python dask_ml.decomposition.TruncatedSVD.__init__用法及代碼示例
- Python dask_ml.wrappers.ParallelPostFit用法及代碼示例
- Python dask_ml.feature_extraction.text.CountVectorizer用法及代碼示例
- Python dask_ml.preprocessing.MinMaxScaler用法及代碼示例
- Python dask_ml.preprocessing.Categorizer用法及代碼示例
- Python dask_ml.linear_model.LinearRegression用法及代碼示例
- Python dask_ml.wrappers.Incremental用法及代碼示例
- Python dask_ml.metrics.mean_squared_log_error用法及代碼示例
- Python dask_ml.model_selection.GridSearchCV用法及代碼示例
- Python dask_ml.preprocessing.OrdinalEncoder用法及代碼示例
- Python dask_ml.feature_extraction.text.FeatureHasher用法及代碼示例
- Python dask_ml.preprocessing.LabelEncoder用法及代碼示例
- Python dask_ml.ensemble.BlockwiseVotingClassifier用法及代碼示例
- Python dask_ml.model_selection.train_test_split用法及代碼示例
- Python dask_ml.feature_extraction.text.HashingVectorizer用法及代碼示例
- Python dask_ml.preprocessing.PolynomialFeatures用法及代碼示例
- Python dask_ml.linear_model.LogisticRegression用法及代碼示例
- Python dask_ml.xgboost.train用法及代碼示例
注:本文由純淨天空篩選整理自dask.org大神的英文原創作品 dask_ml.datasets.make_blobs。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。