From 099c21396a5eeb5fc0455ccfc05a49738ec2260a Mon Sep 17 00:00:00 2001 From: Gabriel Stefanini Vicente Date: Fri, 22 Oct 2021 15:48:07 -0400 Subject: [PATCH] DOC Ensures that LabelSpreading passes numpydoc validation --- 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 3afc2b9e5cc18..ee7a48d880495 100644 --- a/maint_tools/test_docstrings.py +++ b/maint_tools/test_docstrings.py @@ -13,7 +13,6 @@ # List of modules ignored when checking for numpydoc validation. DOCSTRING_IGNORE_LIST = [ - "LabelSpreading", "MultiTaskElasticNetCV", "OrthogonalMatchingPursuitCV", "PassiveAggressiveRegressor", 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"