make_moons
是函数用来生成数据集,在sklearn.datasets
里,具体用法如下:
Parameters:
n_samples : int, optional (default=100)
The total number of points generated.
shuffle : bool, optional (default=True)
Whether to shuffle the samples.
noise : double or None (default=None)
Standard deviation of Gaussian noise added to the data.
random_state : int, RandomState instance or None (default)
Determines random number generation for dataset shuffling and noise. Pass an int for reproducible output across multiple function calls. See Glossary.
Returns:
X : array of shape [n_samples, 2]
The generated samples.
y : array of shape [n_samples]
The integer labels (0 or 1) for class membership of each sample.
主要参数作用如下:
n_numbers
:生成样本数量
shuffle
:是否打乱,类似于将数据集random
一下
noise
:默认是false
,数据集是否加入高斯噪声
random_state
:生成随机种子,给定一个int
型数据,能够保证每次生成数据相同。
sklearn.datasets.make_moons(n_samples=100, shuffle=True, noise=None, random_state=None)
for example:
X, y = datasets.make_moons(500, noise=0.5)
Ref:
【1】https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_moons.html