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

Skip to content

Commit dde6fb5

Browse files
embanderaglemaitre
andauthored
DOC Ensures that DummyClassifier passes numpydoc validation (scikit-learn#20639)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
1 parent 1b9e7e8 commit dde6fb5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

maint_tools/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"DecisionTreeRegressor",
1919
"DictVectorizer",
2020
"DictionaryLearning",
21-
"DummyClassifier",
2221
"ElasticNetCV",
2322
"ExtraTreeRegressor",
2423
"FactorAnalysis",

sklearn/dummy.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ class DummyClassifier(MultiOutputMixin, ClassifierMixin, BaseEstimator):
8484
True if the array returned from predict is to be in sparse CSC format.
8585
Is automatically set to True if the input y is passed in sparse format.
8686
87+
See Also
88+
--------
89+
DummyRegressor : Regressor that makes predictions using simple rules.
90+
8791
Examples
8892
--------
8993
>>> import numpy as np
@@ -121,6 +125,7 @@ def fit(self, X, y, sample_weight=None):
121125
Returns
122126
-------
123127
self : object
128+
Returns the instance itself.
124129
"""
125130
allowed_strategies = (
126131
"most_frequent",
@@ -362,7 +367,7 @@ def predict_log_proba(self, X):
362367
Parameters
363368
----------
364369
X : {array-like, object with finite length or shape}
365-
Training data, requires length = n_samples
370+
Training data.
366371
367372
Returns
368373
-------
@@ -411,7 +416,6 @@ def score(self, X, y, sample_weight=None):
411416
-------
412417
score : float
413418
Mean accuracy of self.predict(X) wrt. y.
414-
415419
"""
416420
if X is None:
417421
X = np.zeros(shape=(len(y), 1))

0 commit comments

Comments
 (0)
0