sklearn.datasets.make_sparse_uncorrelated?
sklearn.datasets.make_sparse_uncorrelated(n_samples=100, n_features=10, *, random_state=None)
使用稀疏的不相關設計生成隨機回歸問題
該數據集在Celeux等人的文獻[1]中進行了描述。如:
X ~ N(0, 1)
y(X) = X[:, 0] + 2 * X[:, 1] - 2 * X[:, 2] - 1.5 * X[:, 3]
只有前4個特征可以提供信息。其余特征用不到。
在用戶指南中閱讀更多內容。
參數 | 說明 |
---|---|
n_samples | int, optional (default=100) 樣本數。 |
n_features | int, optional (default=10) 特征數。 |
random_state | int, RandomState instance, default=None 確定用于生成數據集的隨機數生成。為多個函數調用傳遞可重復輸出的int值。請參閱詞匯表。 |
返回值 | 說明 |
---|---|
X | array of shape [n_samples, n_features] 輸入樣本。 |
y | array of shape [n_samples] 輸出值。 |
參考
1
G. Celeux, M. El Anbari, J.-M. Marin, C. P. Robert, “Regularization in regression: comparing Bayesian and frequentist methods in a poorly informative situation”, 2009.