@@ -184,6 +184,10 @@ def predict(self, X):
184
184
y : ndarray of shape (n_samples,)
185
185
Predictions for input data.
186
186
"""
187
+ # Note: since `predict` does not accept semi-supervised labels as input,
188
+ # `fit(X, y).predict(X) != fit(X, y).transduction_`.
189
+ # Hence, `fit_predict` is not implemented.
190
+ # See https://github.com/scikit-learn/scikit-learn/pull/24898
187
191
probas = self .predict_proba (X )
188
192
return self .classes_ [np .argmax (probas , axis = 1 )].ravel ()
189
193
@@ -244,7 +248,7 @@ def fit(self, X, y):
244
248
y : array-like of shape (n_samples,)
245
249
Target class values with unlabeled points marked as -1.
246
250
All unlabeled samples will be transductively assigned labels
247
- internally.
251
+ internally, which are stored in `transduction_` .
248
252
249
253
Returns
250
254
-------
@@ -371,7 +375,7 @@ class LabelPropagation(BaseLabelPropagation):
371
375
Categorical distribution for each item.
372
376
373
377
transduction_ : ndarray of shape (n_samples)
374
- Label assigned to each item via the transduction .
378
+ Label assigned to each item during :term:`fit` .
375
379
376
380
n_features_in_ : int
377
381
Number of features seen during :term:`fit`.
@@ -466,7 +470,7 @@ def fit(self, X, y):
466
470
y : array-like of shape (n_samples,)
467
471
Target class values with unlabeled points marked as -1.
468
472
All unlabeled samples will be transductively assigned labels
469
- internally.
473
+ internally, which are stored in `transduction_` .
470
474
471
475
Returns
472
476
-------
@@ -531,7 +535,7 @@ class LabelSpreading(BaseLabelPropagation):
531
535
Categorical distribution for each item.
532
536
533
537
transduction_ : ndarray of shape (n_samples,)
534
- Label assigned to each item via the transduction .
538
+ Label assigned to each item during :term:`fit` .
535
539
536
540
n_features_in_ : int
537
541
Number of features seen during :term:`fit`.
0 commit comments