Skip to content

Commit

Permalink
DOC Document that fetch_20newsgroups also returns target_names (#12783)
Browse files Browse the repository at this point in the history
  • Loading branch information
eamanu authored and qinhanmin2014 committed Dec 23, 2018
1 parent 0e5feb6 commit 19a7c08
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions sklearn/datasets/twenty_newsgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,13 @@ def fetch_20newsgroups(data_home=None, subset='train', categories=None,
Returns
-------
bunch : Bunch object
bunch.data: list, length [n_samples]
bunch.target: array, shape [n_samples]
bunch.filenames: list, length [n_classes]
bunch.DESCR: a description of the dataset.
bunch : Bunch object with the following attribute:
- bunch.data: list, length [n_samples]
- bunch.target: array, shape [n_samples]
- bunch.filenames: list, length [n_samples]
- bunch.DESCR: a description of the dataset.
- bunch.target_names: a list of categories of the returned data,
length [n_classes]. This depends on the `categories` parameter.
"""

data_home = get_data_home(data_home=data_home)
Expand Down Expand Up @@ -369,11 +371,12 @@ def fetch_20newsgroups_vectorized(subset="train", remove=(), data_home=None,
Returns
-------
bunch : Bunch object
bunch.data: sparse matrix, shape [n_samples, n_features]
bunch.target: array, shape [n_samples]
bunch.target_names: list, length [n_classes]
bunch.DESCR: a description of the dataset.
bunch : Bunch object with the following attribute:
- bunch.data: sparse matrix, shape [n_samples, n_features]
- bunch.target: array, shape [n_samples]
- bunch.target_names: a list of categories of the returned data,
length [n_classes].
- bunch.DESCR: a description of the dataset.
(data, target) : tuple if ``return_X_y`` is True
Expand Down

0 comments on commit 19a7c08

Please sign in to comment.