8000 DOC Ensures that NuSVR passes numpydoc validation (#20643) · rth/scikit-learn@b4b2846 · GitHub
[go: up one dir, main page]

Skip to content

Commit b4b2846

Browse files
authored
DOC Ensures that NuSVR passes numpydoc validation (scikit-learn#20643)
1 parent 8647634 commit b4b2846

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

maint_tools/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"NearestCentroid",
7373
"NeighborhoodComponentsAnalysis",
7474
"Normalizer",
75-
"NuSVR",
7675
"Nystroem",
7776
"OPTICS",
7877
"OneVsOneClassifier",

sklearn/svm/_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ def predict(self, X):
408408
Returns
409409
-------
410410
y_pred : ndarray of shape (n_samples,)
411+
The predicted values.
411412
"""
412413
X = self._validate_for_predict(X)
413414
predict = self._sparse_predict if self._sparse else self._dense_predict

sklearn/svm/_classes.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,21 +1304,6 @@ class NuSVR(RegressorMixin, BaseLibSVM):
13041304
support_vectors_ : ndarray of shape (n_SV, n_features)
13051305
Support vectors.
13061306
1307-
Examples
1308-
--------
1309-
>>> from sklearn.svm import NuSVR
1310-
>>> from sklearn.pipeline import make_pipeline
1311-
>>> from sklearn.preprocessing import StandardScaler
1312-
>>> import numpy as np
1313-
>>> n_samples, n_features = 10, 5
1314-
>>> np.random.seed(0)
1315-
>>> y = np.random.randn(n_samples)
1316-
>>> X = np.random.randn(n_samples, n_features)
1317-
>>> regr = make_pipeline(StandardScaler(), NuSVR(C=1.0, nu=0.1))
1318-
>>> regr.fit(X, y)
1319-
Pipeline(steps=[('standardscaler', StandardScaler()),
1320-
('nusvr', NuSVR(nu=0.1))])
1321-
13221307
See Also
13231308
--------
13241309
NuSVC : Support Vector Machine for classification implemented with libsvm
@@ -1335,6 +1320,21 @@ class NuSVR(RegressorMixin, BaseLibSVM):
13351320
.. [2] `Platt, John (1999). "Probabilistic outputs for support vector
13361321
machines and comparison to regularizedlikelihood methods."
13371322
<http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.41.1639>`_
1323+
1324+
Examples
1325+
--------
1326+
>>> from sklearn.svm import NuSVR
1327+
>>> from sklearn.pipeline import make_pipeline
1328+
>>> from sklearn.preprocessing import StandardScaler
1329+
>>> import numpy as np
1330+
>>> n_samples, n_features = 10, 5
1331+
>>> np.random.seed(0)
1332+
>>> y = np.random.randn(n_samples)
1333+
>>> X = np.random.randn(n_samples, n_features)
1334+
>>> regr = make_pipeline(StandardScaler(), NuSVR(C=1.0, nu=0.1))
1335+
>>> regr.fit(X, y)
1336+
Pipeline(steps=[('standardscaler', StandardScaler()),
1337+
('nusvr', NuSVR(nu=0.1))])
13381338
"""
13391339

13401340
_impl = "nu_svr"

0 commit comments

Comments
 (0)
0