diff --git a/sklearn/datasets/twenty_newsgroups.py b/sklearn/datasets/twenty_newsgroups.py index 2a30efac03572..dd47d9962c42f 100644 --- a/sklearn/datasets/twenty_newsgroups.py +++ b/sklearn/datasets/twenty_newsgroups.py @@ -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) @@ -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