sklearn.datasets.make_friedman1?

sklearn.datasets.make_friedman1(n_samples=100, n_features=10, *, noise=0.0, random_state=None)

[源碼]

生成“Friedman#1”回歸問題

該數據集在Friedman[1]和Breiman[2]中進行了描述。

輸入X是獨立的特征,均勻分布在間隔[0,1]上。根據以下公式創建輸出y:

y(X) = 10 * sin(pi * X[:, 0] * X[:, 1]) + 20 * (X[:, 2] - 0.5) ** 2 + 10 * X[:, 3] + 5 * X[:, 4] + noise * N(01).

在n_features個特征中,實際上只有5個用于計算y。其余特征與y無關。

特征數量必須> = 5。

在用戶指南中閱讀更多內容。

參數 說明
n_samples int, optional (default=100)
樣本數。
n_features int, optional (default=10)
特征數量。至少應為5。
noise float, optional (default=0.0)
應用于輸出的高斯噪聲的標準偏差。
random_state int, RandomState instance, default=None
確定數據集噪聲的隨機數生成。為多個函數調用傳遞可重復輸出的int值。請參閱詞匯表
返回值 說明
X array of shape [n_samples, n_features]
輸入樣本。
y array of shape [n_samples]
輸出值

參考

  • 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.