Skip to content

Commit 5874e74

Browse files
committed
Merge pull request scikit-learn#2799 from charlescearl/charles-label-prop-doc-updates
Added docstrings for model attributes in LabelPropagation and LabelSprea...
2 parents c9e049c + 1666c4f commit 5874e74

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

sklearn/semi_supervised/label_propagation.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353

5454
# Authors: Clay Woolam <[email protected]>
5555
# Licence: BSD
56-
5756
from abc import ABCMeta, abstractmethod
5857
from scipy import sparse
5958
import numpy as np
@@ -95,6 +94,7 @@ class BaseLabelPropagation(six.with_metaclass(ABCMeta, BaseEstimator,
9594
tol : float
9695
Convergence tolerance: threshold to consider the system at steady
9796
state
97+
9898
"""
9999

100100
def __init__(self, kernel='rbf', gamma=20, n_neighbors=7,
@@ -280,6 +280,20 @@ class LabelPropagation(BaseLabelPropagation):
280280
Convergence tolerance: threshold to consider the system at steady
281281
state
282282
283+
Attributes
284+
----------
285+
`X_` : array, shape = [n_samples, n_features]
286+
Input array
287+
288+
`classes_` : array, shape = [n_classes]
289+
The distinct labels used in classifying instances.
290+
291+
`label_distributions_` : array, shape = [n_samples, n_classes]
292+
Categorical distribution for each item
293+
294+
`transduction_` : array, shape = [n_samples]
295+
Label assigned to each item via the transduction
296+
283297
Examples
284298
--------
285299
>>> from sklearn import datasets
@@ -345,6 +359,20 @@ class LabelSpreading(BaseLabelPropagation):
345359
Convergence tolerance: threshold to consider the system at steady
346360
state
347361
362+
Attributes
363+
----------
364+
`X_` : array, shape = [n_samples, n_features]
365+
Input array
366+
367+
`classes_` : array, shape = [n_classes]
368+
The distinct labels used in classifying instances.
369+
370+
`label_distributions_` : array, shape = [n_samples, n_classes]
371+
Categorical distribution for each item
372+
373+
`transduction_` : array, shape = [n_samples]
374+
Label assigned to each item via the transduction
375+
348376
Examples
349377
--------
350378
>>> from sklearn import datasets

0 commit comments

Comments
 (0)