Skip to content

DOC Ensures that NuSVC passes numpydoc validation #20461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion maint_tools/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
"NearestCentroid",
"NeighborhoodComponentsAnalysis",
"Normalizer",
"NuSVC",
"NuSVR",
"Nystroem",
"OAS",
Expand Down
30 changes: 15 additions & 15 deletions sklearn/svm/_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ class NuSVC(BaseSVC):
SVC. If not given, all classes are supposed to have
weight one. The "balanced" mode uses the values of y to automatically
adjust weights inversely proportional to class frequencies as
``n_samples / (n_classes * np.bincount(y))``
``n_samples / (n_classes * np.bincount(y))``.

verbose : bool, default=False
Enable verbose output. Note that this setting takes advantage of a
Expand Down Expand Up @@ -927,20 +927,6 @@ class NuSVC(BaseSVC):
shape_fit_ : tuple of int of shape (n_dimensions_of_X,)
Array dimensions of training vector ``X``.

Examples
--------
>>> import numpy as np
>>> X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]])
>>> y = np.array([1, 1, 2, 2])
>>> from sklearn.pipeline import make_pipeline
>>> from sklearn.preprocessing import StandardScaler
>>> from sklearn.svm import NuSVC
>>> clf = make_pipeline(StandardScaler(), NuSVC())
>>> clf.fit(X, y)
Pipeline(steps=[('standardscaler', StandardScaler()), ('nusvc', NuSVC())])
>>> print(clf.predict([[-0.8, -1]]))
[1]

See Also
--------
SVC : Support Vector Machine for classification using libsvm.
Expand All @@ -956,6 +942,20 @@ class NuSVC(BaseSVC):
.. [2] `Platt, John (1999). "Probabilistic outputs for support vector
machines and comparison to regularizedlikelihood methods."
<http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.41.1639>`_

Examples
--------
>>> import numpy as np
>>> X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]])
>>> y = np.array([1, 1, 2, 2])
>>> from sklearn.pipeline import make_pipeline
>>> from sklearn.preprocessing import StandardScaler
>>> from sklearn.svm import NuSVC
>>> clf = make_pipeline(StandardScaler(), NuSVC())
>>> clf.fit(X, y)
Pipeline(steps=[('standardscaler', StandardScaler()), ('nusvc', NuSVC())])
>>> print(clf.predict([[-0.8, -1]]))
[1]
"""

_impl = "nu_svc"
Expand Down