8000 DOC Fix doc of defaults in sklearn.utils.estimator_checks.py (#18037) · scikit-learn/scikit-learn@6c9d809 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6c9d809

Browse files
authored
DOC Fix doc of defaults in sklearn.utils.estimator_checks.py (#18037)
1 parent 863b5ba commit 6c9d809

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

sklearn/utils/estimator_checks.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,11 @@ def _set_check_estimator_ids(obj):
301301
Parameters
302302
----------
303303
obj : estimator or function
304-
Items generated by `check_estimator`
304+
Items generated by `check_estimator`.
305305
306306
Returns
307307
-------
308-
id : string or None
308+
id : str or None
309309
310310
See also
311311
--------
@@ -327,7 +327,7 @@ def _set_check_estimator_ids(obj):
327327

328328

329329
def _construct_instance(Estimator):
330-
"""Construct Estimator instance if possible"""
330+
"""Construct Estimator instance if possible."""
331331
required_parameters = getattr(Estimator, "_required_parameters", [])
332332
if len(required_parameters):
333333
if required_parameters in (["estimator"], ["base_estimator"]):
@@ -346,7 +346,7 @@ def _construct_instance(Estimator):
346346

347347
def _mark_xfail_checks(estimator, check, pytest):
348348
"""Mark (estimator, check) pairs with xfail according to the
349-
_xfail_checks_ tag"""
349+
_xfail_checks_ tag."""
350350
xfail_checks = estimator._get_tags()['_xfail_checks'] or {}
351351
check_name = _set_check_estimator_ids(check)
352352

@@ -462,7 +462,7 @@ def check_estimator(Estimator, generate_only=False):
462462
Passing a class was deprecated in version 0.23, and support for
463463
classes was removed in 0.24.
464464
465-
generate_only : bool, optional (default=False)
465+
generate_only : bool, default=False
466466
When `False`, checks are evaluated when `check_estimator` is called.
467467
When `True`, `check_estimator` returns a generator that yields
468468
(estimator, check) tuples. The check is run by calling
@@ -597,7 +597,7 @@ def _set_checking_parameters(estimator):
597597

598598

599599
class _NotAnArray:
600-
"""An object that is convertible to an array
600+
"""An object that is convertible to an array.
601601
602602
Parameters
603603
----------
@@ -663,12 +663,12 @@ def _pairwise_estimator_convert_X(X, estimator, kernel=linear_kernel):
663663

664664

665665
def _generate_sparse_matrix(X_csr):
666-
"""Generate sparse matrices with {32,64}bit indices of diverse format
666+
"""Generate sparse matrices with {32,64}bit indices of diverse format.
667667
668668
Parameters
669669
----------
670670
X_csr: CSR Matrix
671-
Input matrix in CSR format
671+
Input matrix in CSR format.
672672
673673
Returns
674674
-------
@@ -1498,7 +1498,7 @@ def check_estimators_nan_inf(name, estimator_orig):
14981498

14991499
@ignore_warnings
15001500
def check_nonsquare_error(name, estimator_orig):
1501-
"""Test that error is thrown when non-square data provided"""
1501+
"""Test that error is thrown when non-square data provided."""
15021502

15031503
X, y = make_blobs(n_samples=20, n_features=10)
15041504
estimator = clone(estimator_orig)
@@ -1511,7 +1511,7 @@ def check_nonsquare_error(name, estimator_orig):
15111511

15121512
@ignore_warnings
15131513
def check_estimators_pickle(name, estimator_orig):
1514-
"""Test that we can pickle all estimators"""
1514+
"""Test that we can pickle all estimators."""
15151515
check_methods = ["predict", "transform", "decision_function",
15161516
"predict_proba"]
15171517

@@ -1722,7 +1722,7 @@ def check_clustering(name, clusterer_orig, readonly_memmap=False):
17221722

17231723
@ignore_warnings(category=FutureWarning)
17241724
def check_clusterer_compute_labels_predict(name, clusterer_orig):
1725-
"""Check that predict is invariant of compute_labels"""
1725+
"""Check that predict is invariant of compute_labels."""
17261726
X, y = make_blobs(n_samples=20, random_state=0)
17271727
clusterer = clone(clusterer_orig)
17281728
set_random_state(clusterer)
@@ -2027,7 +2027,7 @@ def check_classifiers_multilabel_representation_invariance(name,
20272027
@ignore_warnings(category=FutureWarning)
20282028
def check_estimators_fit_returns_self(name, estimator_orig,
20292029
readonly_memmap=False):
2030-
"""Check if self is returned when calling fit"""
2030+
"""Check if self is returned when calling fit."""
20312031
X, y = make_blobs(random_state=0, n_samples=21)
20322032
# some want non-negative input
20332033
X -= X.min()
@@ -2423,7 +2423,7 @@ def check_estimators_overwrite_params(name, estimator_orig):
24232423

24242424
@ignore_warnings(category=FutureWarning)
24252425
def check_no_attributes_set_in_init(name, estimator_orig):
2426-
"""Check setting during init. """
2426+
"""Check setting during init."""
24272427
estimator = clone(estimator_orig)
24282428
if hasattr(type(estimator).__init__, "deprecated_original"):
24292429
return
@@ -2570,7 +2570,7 @@ def check_parameters_default_constructible(name, Estimator):
25702570

25712571
try:
25722572
def param_filter(p):
2573-
"""Identify hyper parameters of an estimator"""
2573+
"""Identify hyper parameters of an estimator."""
25742574
return (p.name != 'self' and
25752575
p.kind != p.VAR_KEYWORD and
25762576
p.kind != p.VAR_POSITIONAL)

0 commit comments

Comments
 (0)
0