From d6e24ee79fc4d7119b714b16e988c29b2fcbeb95 Mon Sep 17 00:00:00 2001 From: Gabriel Stefanini Vicente Date: Sat, 23 Oct 2021 07:00:25 -0400 Subject: [PATCH] DOC Ensures that LabelSpreading passes numpydoc validation (#21414) --- maint_tools/test_docstrings.py | 1 - sklearn/semi_supervised/_label_propagation.py | 22 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/maint_tools/test_docstrings.py b/maint_tools/test_docstrings.py index e855a1fde99b2..5ba1ed2b2c041 100644 --- a/maint_tools/test_docstrings.py +++ b/maint_tools/test_docstrings.py @@ -9,7 +9,6 @@ # List of modules ignored when checking for numpydoc validation. DOCSTRING_IGNORE_LIST = [ - "LabelSpreading", "MultiTaskElasticNetCV", "SpectralCoclustering", "SpectralEmbedding", diff --git a/sklearn/semi_supervised/_label_propagation.py b/sklearn/semi_supervised/_label_propagation.py index ef4226558fbcb..1e3684797ebe6 100644 --- a/sklearn/semi_supervised/_label_propagation.py +++ b/sklearn/semi_supervised/_label_propagation.py @@ -476,7 +476,7 @@ def fit(self, X, y): class LabelSpreading(BaseLabelPropagation): - """LabelSpreading model for semi-supervised learning + """LabelSpreading model for semi-supervised learning. This model is similar to the basic Label Propagation algorithm, but uses affinity matrix based on the normalized graph Laplacian @@ -546,6 +546,16 @@ class LabelSpreading(BaseLabelPropagation): n_iter_ : int Number of iterations run. + See Also + -------- + LabelPropagation : Unregularized graph based semi-supervised learning. + + References + ---------- + Dengyong Zhou, Olivier Bousquet, Thomas Navin Lal, Jason Weston, + Bernhard Schoelkopf. Learning with local and global consistency (2004) + http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.115.3219 + Examples -------- >>> import numpy as np @@ -559,16 +569,6 @@ class LabelSpreading(BaseLabelPropagation): >>> labels[random_unlabeled_points] = -1 >>> label_prop_model.fit(iris.data, labels) LabelSpreading(...) - - References - ---------- - Dengyong Zhou, Olivier Bousquet, Thomas Navin Lal, Jason Weston, - Bernhard Schoelkopf. Learning with local and global consistency (2004) - http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.115.3219 - - See Also - -------- - LabelPropagation : Unregularized graph based semi-supervised learning. """ _variant = "spreading"