y
y(X) = 10 * sin(pi * X[:, 0] * X[:, 1]) + 20 * (X[:, 2] - 0.5) ** 2 + 10 * X[:, 3] + 5 * X[:, 4] + noise * N(0, 1).
Out of the n_features features, only 5 are actually used to compute
y. The remaining features are independent of y.
The number of features has to be >= 5.
- Parameters:
- n_samples : int, default=100
The number of samples.
- n_features : int, default=10
The number of features. Should be at least 5.
- noise : float, default=0.0
The standard deviation of the gaussian noise applied to the output.
- random_state : int, RandomState instance or None, default=None
Determines random number generation for dataset noise. Pass an int
for reproducible output across multiple function calls.
See Glossary.
- Returns:
- X : ndarray of shape (n_samples, n_features)
The input samples.
- y : ndarray of shape (n_samples,)
The output values.
References
Examples
from sklearn.datasets import make_friedman1
X, y = make_friedman1(random_state=42)
X.shape
(100, 10)
y.shape
(100,)
list(y[:3])
[np.float64(16.8), np.float64(5.87), np.float64(9.46)]