make_sparse_uncorrelated#

sklearn.datasets.make_sparse_uncorrelated(n_samples=100,n_features=10,*,random_state=None)[source]#

Generate a random regression problem with sparse uncorrelated design.

This dataset is described in Celeux et al [1]. as:

X~N(0,1)y(X)=X[:,0]+2*X[:,1]-2*X[:,2]-1.5*X[:,3]

Only the first 4 features are informative. The remaining features areuseless.

Read more in theUser Guide.

Parameters:
n_samplesint, default=100

The number of samples.

n_featuresint, default=10

The number of features.

random_stateint, RandomState instance or None, default=None

Determines random number generation for dataset creation. Pass an intfor reproducible output across multiple function calls.SeeGlossary.

Returns:
Xndarray of shape (n_samples, n_features)

The input samples.

yndarray of shape (n_samples,)

The output values.

References

[1]

G. Celeux, M. El Anbari, J.-M. Marin, C. P. Robert,“Regularization in regression: comparing Bayesian and frequentistmethods in a poorly informative situation”, 2009.

Examples

>>>fromsklearn.datasetsimportmake_sparse_uncorrelated>>>X,y=make_sparse_uncorrelated(random_state=0)>>>X.shape(100, 10)>>>y.shape(100,)