make_friedman3#

sklearn.datasets.make_friedman3(n_samples=100, *, noise=0.0, random_state=None)[source]#

生成“Friedman #3”回归问题。

该数据集在 Friedman [1] 和 Breiman [2] 中有所描述。

输入 X 是 4 个独立特征,在区间上均匀分布

0 <= X[:, 0] <= 100,
40 * pi <= X[:, 1] <= 560 * pi,
0 <= X[:, 2] <= 1,
1 <= X[:, 3] <= 11.

输出 y 根据公式创建

y(X) = arctan((X[:, 1] * X[:, 2] - 1 / (X[:, 1] * X[:, 3])) / X[:, 0]) + noise * N(0, 1).

用户指南中阅读更多内容。

参数:
n_samplesint, default=100

样本数。

noisefloat, default=0.0

应用于输出的高斯噪声的标准差。

random_stateint, RandomState instance or None, default=None

确定数据集噪声的随机数生成。传入一个 int 以在多次函数调用中获得可重现的输出。请参阅 词汇表

返回:
X形状为 (n_samples, 4) 的 ndarray

输入样本。

yndarray of shape (n_samples,)

输出值。

References

[1]

J. Friedman, “Multivariate adaptive regression splines”, The Annals of Statistics 19 (1), pages 1-67, 1991.

[2]

L. Breiman, “Bagging predictors”, Machine Learning 24, pages 123-140, 1996.

示例

>>> from sklearn.datasets import make_friedman3
>>> X, y = make_friedman3(random_state=42)
>>> X.shape
(100, 4)
>>> y.shape
(100,)
>>> list(y[:3])
[np.float64(1.54), np.float64(0.956), np.float64(0.414)]