sklearn.datasets.make_blobs()函数用法


参考:https://scikit-learn.org/dev/modules/generated/sklearn.datasets.make_blobs.html

函数原型:sklearn.datasets.make_blobs(n_samples=100n_features=2centers=Nonecluster_std=1.0center_box=(-10.010.0)shuffle=Truerandom_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:

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM