@@ -301,11 +301,11 @@ def _set_check_estimator_ids(obj):
301
301
Parameters
302
302
----------
303
303
obj : estimator or function
304
- Items generated by `check_estimator`
304
+ Items generated by `check_estimator`.
305
305
306
306
Returns
307
307
-------
308
- id : string or None
308
+ id : str or None
309
309
310
310
See also
311
311
--------
@@ -327,7 +327,7 @@ def _set_check_estimator_ids(obj):
327
327
328
328
329
329
def _construct_instance (Estimator ):
330
- """Construct Estimator instance if possible"""
330
+ """Construct Estimator instance if possible. """
331
331
required_parameters = getattr (Estimator , "_required_parameters" , [])
332
332
if len (required_parameters ):
333
333
if required_parameters in (["estimator" ], ["base_estimator" ]):
@@ -346,7 +346,7 @@ def _construct_instance(Estimator):
346
346
347
347
def _mark_xfail_checks (estimator , check , pytest ):
348
348
"""Mark (estimator, check) pairs with xfail according to the
349
- _xfail_checks_ tag"""
349
+ _xfail_checks_ tag. """
350
350
xfail_checks = estimator ._get_tags ()['_xfail_checks' ] or {}
351
351
check_name = _set_check_estimator_ids (check )
352
352
@@ -462,7 +462,7 @@ def check_estimator(Estimator, generate_only=False):
462
462
Passing a class was deprecated in version 0.23, and support for
463
463
classes was removed in 0.24.
464
464
465
- generate_only : bool, optional ( default=False)
465
+ generate_only : bool, default=False
466
466
When `False`, checks are evaluated when `check_estimator` is called.
467
467
When `True`, `check_estimator` returns a generator that yields
468
468
(estimator, check) tuples. The check is run by calling
@@ -597,7 +597,7 @@ def _set_checking_parameters(estimator):
597
597
598
598
599
599
class _NotAnArray :
600
- """An object that is convertible to an array
600
+ """An object that is convertible to an array.
601
601
602
602
Parameters
603
603
----------
@@ -663,12 +663,12 @@ def _pairwise_estimator_convert_X(X, estimator, kernel=linear_kernel):
663
663
664
664
665
665
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.
667
667
668
668
Parameters
669
669
----------
670
670
X_csr: CSR Matrix
671
- Input matrix in CSR format
671
+ Input matrix in CSR format.
672
672
673
673
Returns
674
674
-------
@@ -1498,7 +1498,7 @@ def check_estimators_nan_inf(name, estimator_orig):
1498
1498
1499
1499
@ignore_warnings
1500
1500
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. """
1502
1502
1503
1503
X , y = make_blobs (n_samples = 20 , n_features = 10 )
1504
1504
estimator = clone (estimator_orig )
@@ -1511,7 +1511,7 @@ def check_nonsquare_error(name, estimator_orig):
1511
1511
1512
1512
@ignore_warnings
1513
1513
def check_estimators_pickle (name , estimator_orig ):
1514
- """Test that we can pickle all estimators"""
1514
+ """Test that we can pickle all estimators. """
1515
1515
check_methods = ["predict" , "transform" , "decision_function" ,
1516
1516
"predict_proba" ]
1517
1517
@@ -1722,7 +1722,7 @@ def check_clustering(name, clusterer_orig, readonly_memmap=False):
1722
1722
1723
1723
@ignore_warnings (category = FutureWarning )
1724
1724
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. """
1726
1726
X , y = make_blobs (n_samples = 20 , random_state = 0 )
1727
1727
clusterer = clone (clusterer_orig )
1728
1728
set_random_state (clusterer )
@@ -2027,7 +2027,7 @@ def check_classifiers_multilabel_representation_invariance(name,
2027
2027
@ignore_warnings (category = FutureWarning )
2028
2028
def check_estimators_fit_returns_self (name , estimator_orig ,
2029
2029
readonly_memmap = False ):
2030
- """Check if self is returned when calling fit"""
2030
+ """Check if self is returned when calling fit. """
2031
2031
X , y = make_blobs (random_state = 0 , n_samples = 21 )
2032
2032
# some want non-negative input
2033
2033
X -= X .min ()
@@ -2423,7 +2423,7 @@ def check_estimators_overwrite_params(name, estimator_orig):
2423
2423
2424
2424
@ignore_warnings (category = FutureWarning )
2425
2425
def check_no_attributes_set_in_init (name , estimator_orig ):
2426
- """Check setting during init. """
2426
+ """Check setting during init."""
2427
2427
estimator = clone (estimator_orig )
2428
2428
if hasattr (type (estimator ).__init__ , "deprecated_original" ):
2429
2429
return
@@ -2570,7 +2570,7 @@ def check_parameters_default_constructible(name, Estimator):
2570
2570
2571
2571
try :
2572
2572
def param_filter (p ):
2573
- """Identify hyper parameters of an estimator"""
2573
+ """Identify hyper parameters of an estimator. """
2574
2574
return (p .name != 'self' and
2575
2575
p .kind != p .VAR_KEYWORD and
2576
2576
p .kind != p .VAR_POSITIONAL )
0 commit comments