This documentation is for scikit-learn version 0.10Other versions

Citing

If you use the software, please consider citing scikit-learn.

This page

8.4.2.6. sklearn.datasets.make_friedman2

sklearn.datasets.make_friedman2(n_samples=100, noise=0.0, random_state=None)

Generate the “Friedman #2” regression problem

This dataset is described in Friedman [1] and Breiman [2].

Inputs X are 4 independent features uniformly distributed on the intervals:

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

The output y is created according to the formula:

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

n_samples : int, optional (default=100)

The number of samples.

noise : float, optional (default=0.0)

The standard deviation of the gaussian noise applied to the output.

random_state : int, RandomState instance or None, optional (default=None)

If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.

Returns :

X : array of shape [n_samples, 4]

The input samples.

y : array of shape [n_samples]

The output values.

Notes

References:

[R47]J. Friedman, “Multivariate adaptive regression splines”, The Annals of Statistics 19 (1), pages 1-67, 1991.
[R48]L. Breiman, “Bagging predictors”, Machine Learning 24, pages 123-140, 1996.