Skip to content

Commit a793c1f

Browse files
DennisOseiglemaitreArturoAmorQ
authored
DOC Ensures that sklearn.datasets._base.load_breast_cancer passes numpydoc validation (#22346)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> Co-authored-by: Arturo Amor <86408019+ArturoAmorQ@users.noreply.github.com>
1 parent a4c78b4 commit a793c1f

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

sklearn/datasets/_base.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,10 @@ def load_breast_cancer(*, return_X_y=False, as_frame=False):
660660
Features real, positive
661661
================= ==============
662662
663+
The copy of UCI ML Breast Cancer Wisconsin (Diagnostic) dataset is
664+
downloaded from:
665+
https://goo.gl/U2Uwz2
666+
663667
Read more in the :ref:`User Guide <breast_cancer_dataset>`.
664668
665669
Parameters
@@ -687,33 +691,34 @@ def load_breast_cancer(*, return_X_y=False, as_frame=False):
687691
data : {ndarray, dataframe} of shape (569, 30)
688692
The data matrix. If `as_frame=True`, `data` will be a pandas
689693
DataFrame.
690-
target: {ndarray, Series} of shape (569,)
694+
target : {ndarray, Series} of shape (569,)
691695
The classification target. If `as_frame=True`, `target` will be
692696
a pandas Series.
693-
feature_names: list
697+
feature_names : list
694698
The names of the dataset columns.
695-
target_names: list
699+
target_names : list
696700
The names of target classes.
697-
frame: DataFrame of shape (569, 31)
701+
frame : DataFrame of shape (569, 31)
698702
Only present when `as_frame=True`. DataFrame with `data` and
699703
`target`.
700704
701705
.. versionadded:: 0.23
702-
DESCR: str
706+
DESCR : str
703707
The full description of the dataset.
704-
filename: str
708+
filename : str
705709
The path to the location of the data.
706710
707711
.. versionadded:: 0.20
708712
709713
(data, target) : tuple if ``return_X_y`` is True
714+
A tuple of two ndarrays by default. The first contains a 2D ndarray of
715+
shape (569, 30) with each row representing one sample and each column
716+
representing the features. The second ndarray of shape (569,) contains
717+
the target samples. If `as_frame=True`, both arrays are pandas objects,
718+
i.e. `X` a dataframe and `y` a series.
710719
711720
.. versionadded:: 0.18
712721
713-
The copy of UCI ML Breast Cancer Wisconsin (Diagnostic) dataset is
714-
downloaded from:
715-
https://goo.gl/U2Uwz2
716-
717722
Examples
718723
--------
719724
Let's say you are interested in the samples 10, 50, and 85, and want to
@@ -989,6 +994,7 @@ def load_diabetes(*, return_X_y=False, as_frame=False, scaled=True):
989994
Returns a tuple of two ndarray of shape (n_samples, n_features)
990995
A 2D array with each row representing one sample and each column
991996
representing the features and/or target of a given sample.
997+
992998
.. versionadded:: 0.18
993999
"""
9941000
data_filename = "diabetes_data_raw.csv.gz"

sklearn/tests/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
FUNCTION_DOCSTRING_IGNORE_LIST = [
1515
"sklearn.covariance._shrunk_covariance.ledoit_wolf",
1616
"sklearn.covariance._shrunk_covariance.ledoit_wolf_shrinkage",
17-
"sklearn.datasets._base.load_breast_cancer",
1817
"sklearn.datasets._base.load_digits",
1918
"sklearn.datasets._base.load_linnerud",
2019
"sklearn.datasets._base.load_sample_image",

0 commit comments

Comments
 (0)