sklearn Study Notes (1) - make_blobs function and the corresponding parameters Introduction

make_blobs method:

sklearn.datasets.make_blobs(n_samples=100,n_features=2,centers=3, cluster_std=1.0,center_box=(-10.0,10.0),shuffle=True,random_state=None)

make_blobs function is to generate data set clustering, and generating a data set corresponding tag
n_samples: indicates the number of data sample points, default values 100
n_features: wherein each sample is (or attributes) number, also represents the data dimension, the default value is 2
Centers: indicates the type of number (the number of kinds of tag) , the default value . 3
cluster_std the variance of each category, for example, we want to generate the second data type, wherein a larger variance with another analog may be cluster_std is set to [1.0, 3.0], float or floating-point sequence, the default value is 1.0
center_box: after the data boundary center determines the default value (-10.0, 10.0)
shuffle: the shuffled data, the default value is True
random_state: official website interpretation is the seed of the random generator, the generated data may be fixed, after a given number, the data set is generated every fixed. If a given value, due to the randomness will lead to results obtained each time you run the program may vary. Recommendations given value in practice when using a data generator or machine learning algorithm python practice exercises.

For example: In jupyter notebook can be a simple exercise.

                                       

Guess you like

Origin www.cnblogs.com/qfwmy/p/12085357.html