Skip to content

Commit 8635d96

Browse files
authored
DOC add docstring example for sklearn.datasets.make_gaussian_quantiles (#28230)
1 parent 2eb5722 commit 8635d96

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

sklearn/datasets/_samples_generator.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ def make_gaussian_quantiles(
19331933
19341934
Parameters
19351935
----------
1936-
mean : ndarray of shape (n_features,), default=None
1936+
mean : array-like of shape (n_features,), default=None
19371937
The mean of the multi-dimensional normal distribution.
19381938
If None then use the origin (0, 0, ...).
19391939
@@ -1973,6 +1973,17 @@ def make_gaussian_quantiles(
19731973
References
19741974
----------
19751975
.. [1] J. Zhu, H. Zou, S. Rosset, T. Hastie, "Multi-class AdaBoost", 2009.
1976+
1977+
Examples
1978+
--------
1979+
>>> from sklearn.datasets import make_gaussian_quantiles
1980+
>>> X, y = make_gaussian_quantiles(random_state=42)
1981+
>>> X.shape
1982+
(100, 2)
1983+
>>> y.shape
1984+
(100,)
1985+
>>> list(y[:5])
1986+
[2, 0, 1, 0, 2]
19761987
"""
19771988
if n_samples < n_classes:
19781989
raise ValueError("n_samples must be at least n_classes")

0 commit comments

Comments
 (0)