8000 DOC Ensures that MultiLabelBinarizer passes numpydoc validation by jmloyola · Pull Request #21315 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

DOC Ensures that MultiLabelBinarizer passes numpydoc validation #21315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion maint_tools/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"LabelPropagation",
"LabelSpreading",
"LocallyLinearEmbedding",
"MultiLabelBinarizer",
"MultiTaskElasticNet",
"MultiTaskElasticNetCV",
"MultiTaskLasso",
Expand Down
19 changes: 12 additions & 7 deletions sklearn/preprocessing/_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,11 @@ class MultiLabelBinarizer(TransformerMixin, BaseEstimator):
Otherwise it corresponds to the sorted set of classes found
when fitting.

See Also
--------
OneHotEncoder : Encode categorical features using a one-hot aka one-of-K
scheme.

Examples
--------
>>> from sklearn.preprocessing import MultiLabelBinarizer
Expand Down Expand Up @@ -724,11 +729,6 @@ class MultiLabelBinarizer(TransformerMixin, BaseEstimator):
MultiLabelBinarizer()
>>> mlb.classes_
array(['comedy', 'sci-fi', 'thriller'], dtype=object)

See Also
--------
OneHotEncoder : Encode categorical features using a one-hot aka one-of-K
scheme.
"""

def __init__(self, *, classes=None, sparse_output=False):
Expand All @@ -747,7 +747,8 @@ def fit(self, y):

Returns
-------
self : returns this MultiLabelBinarizer instance
self : object
Fitted estimator.
"""
self._cached_dict = None
if self.classes is None:
Expand Down Expand Up @@ -778,7 +779,7 @@ def fit_transform(self, y):
Returns
-------
y_indicator : {ndarray, sparse matrix} of shape (n_samples, n_classes)
A mat 72F6 rix such that `y_indicator[i, j] = 1` i.f.f. `classes_[j]`
A matrix such that `y_indicator[i, j] = 1` iff `classes_[j]`
is in `y[i]`, and 0 otherwise. Sparse matrix will be of CSR
format.
"""
Expand Down Expand Up @@ -846,6 +847,10 @@ def _transform(self, y, class_mapping):
Parameters
----------
y : iterable of iterables
A set of labels (any orderable and hashable object) for each
sample. If the `classes` parameter is set, `y` will not be
iterated.

class_mapping : Mapping
Maps from label to column index in label indicator matrix.

Expand Down
0