@@ -188,7 +188,6 @@ class LabelBinarizer(TransformerMixin, BaseEstimator):
188
188
189
189
Parameters
190
190
----------
191
-
192
191
neg_label : int, default=0
193
192
Value with which negative labels must be encoded.
194
193
@@ -201,7 +200,6 @@ class LabelBinarizer(TransformerMixin, BaseEstimator):
201
200
202
201
Attributes
203
202
----------
204
-
205
203
classes_ : ndarray of shape (n_classes,)
206
204
Holds the label for each class.
207
205
@@ -215,6 +213,13 @@ class LabelBinarizer(TransformerMixin, BaseEstimator):
215
213
True if the input data to transform is given as a sparse matrix, False
216
214
otherwise.
217
215
216
+ See Also
217
+ --------
218
+ label_binarize : Function to perform the transform operation of
219
+ LabelBinarizer with fixed classes.
220
+ OneHotEncoder : Encode categorical features using a one-hot aka one-of-K
221
+ scheme.
222
+
218
223
Examples
219
224
--------
220
225
>>> from sklearn import preprocessing
@@ -248,13 +253,6 @@ class LabelBinarizer(TransformerMixin, BaseEstimator):
248
253
[0, 1, 0],
249
254
[0, 0, 1],
250
255
[0, 1, 0]])
251
-
252
- See Also
253
- --------
254
- label_binarize : Function to perform the transform operation of
255
- LabelBinarizer with fixed classes.
256
- OneHotEncoder : Encode categorical features using a one-hot aka one-of-K
257
- scheme.
258
256
"""
259
257
260
258
def __init__ (self , * , neg_label = 0 , pos_label = 1 , sparse_output = False ):
@@ -288,7 +286,8 @@ def fit(self, y):
288
286
289
287
Returns
290
288
-------
291
- self : returns an instance of self.
289
+ self : object
290
+ Returns the instance itself.
292
291
"""
293
292
self .y_type_ = type_of_target (y )
294
293
if "multioutput" in self .y_type_ :
@@ -303,8 +302,7 @@ def fit(self, y):
303
302
return self
304
303
305
304
def fit_transform (self , y ):
306
- """Fit label binarizer and transform multi-class labels to binary
307
- labels.
305
+ """Fit label binarizer/transform multi-class labels to binary labels.
308
306
309
307
The output of transform is sometimes referred to as
310
308
the 1-of-K coding scheme.
0 commit comments