Skip to content

Commit fe03879

Browse files
proinsiasagramfort
authored andcommitted
Fix doc refs to StratifiedKFold and KFold (scikit-learn#6936)
Fix links to `StratifiedKFold` and `KFold` in docstrings.
1 parent 5ea317b commit fe03879

File tree

9 files changed

+32
-25
lines changed

9 files changed

+32
-25
lines changed

sklearn/calibration.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ class CalibratedClassifierCV(BaseEstimator, ClassifierMixin):
6363
- An iterable yielding train/test splits.
6464
6565
For integer/None inputs, if ``y`` is binary or multiclass,
66-
:class:`StratifiedKFold` used. If ``y`` is neither binary nor
67-
multiclass, :class:`KFold` is used.
66+
:class:`sklearn.model_selection.StratifiedKFold` is used. If ``y``
67+
is neither binary nor multiclass, :class:`sklearn.model_selection.KFold`
68+
is used.
6869
6970
Refer :ref:`User Guide <cross_validation>` for the various
7071
cross-validation strategies that can be used here.

sklearn/cross_validation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ def cross_val_predict(estimator, X, y=None, cv=None, n_jobs=1,
12261226
- An iterable yielding train/test splits.
12271227
12281228
For integer/None inputs, if the estimator is a classifier and ``y`` is
1229-
either binary or multiclass, :class:`StratifiedKFold` used. In all
1229+
either binary or multiclass, :class:`StratifiedKFold` is used. In all
12301230
other cases, :class:`KFold` is used.
12311231
12321232
Refer :ref:`User Guide <cross_validation>` for the various
@@ -1411,7 +1411,7 @@ def cross_val_score(estimator, X, y=None, scoring=None, cv=None, n_jobs=1,
14111411
- An iterable yielding train/test splits.
14121412
14131413
For integer/None inputs, if the estimator is a classifier and ``y`` is
1414-
either binary or multiclass, :class:`StratifiedKFold` used. In all
1414+
either binary or multiclass, :class:`StratifiedKFold` is used. In all
14151415
other cases, :class:`KFold` is used.
14161416
14171417
Refer :ref:`User Guide <cross_validation>` for the various
@@ -1697,7 +1697,7 @@ def check_cv(cv, X=None, y=None, classifier=False):
16971697
- An iterable yielding train/test splits.
16981698
16991699
For integer/None inputs, if classifier is True and ``y`` is binary or
1700-
multiclass, :class:`StratifiedKFold` used. In all other cases,
1700+
multiclass, :class:`StratifiedKFold` is used. In all other cases,
17011701
:class:`KFold` is used.
17021702
17031703
Refer :ref:`User Guide <cross_validation>` for the various
@@ -1771,7 +1771,7 @@ def permutation_test_score(estimator, X, y, cv=None,
17711771
- An iterable yielding train/test splits.
17721772
17731773
For integer/None inputs, if the estimator is a classifier and ``y`` is
1774-
either binary or multiclass, :class:`StratifiedKFold` used. In all
1774+
either binary or multiclass, :class:`StratifiedKFold` is used. In all
17751775
other cases, :class:`KFold` is used.
17761776
17771777
Refer :ref:`User Guide <cross_validation>` for the various

sklearn/feature_selection/rfe.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,9 @@ class RFECV(RFE, MetaEstimatorMixin):
293293
- An iterable yielding train/test splits.
294294
295295
For integer/None inputs, if ``y`` is binary or multiclass,
296-
:class:`StratifiedKFold` used. If the estimator is a classifier
297-
or if ``y`` is neither binary nor multiclass, :class:`KFold` is used.
296+
:class:`sklearn.model_selection.StratifiedKFold` is used. If the
297+
estimator is a classifier or if ``y`` is neither binary nor multiclass,
298+
:class:`sklearn.model_selection.KFold` is used.
298299
299300
Refer :ref:`User Guide <cross_validation>` for the various
300301
cross-validation strategies that can be used here.

sklearn/grid_search.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,9 @@ class GridSearchCV(BaseSearchCV):
687687
- An iterable yielding train/test splits.
688688
689689
For integer/None inputs, if the estimator is a classifier and ``y`` is
690-
either binary or multiclass, :class:`StratifiedKFold` used. In all
691-
other cases, :class:`KFold` is used.
690+
either binary or multiclass,
691+
:class:`sklearn.model_selection.StratifiedKFold` is used. In all
692+
other cases, :class:`sklearn.model_selection.KFold` is used.
692693
693694
Refer :ref:`User Guide <cross_validation>` for the various
694695
cross-validation strategies that can be used here.
@@ -898,8 +899,9 @@ class RandomizedSearchCV(BaseSearchCV):
898899
- An iterable yielding train/test splits.
899900
900901
For integer/None inputs, if the estimator is a classifier and ``y`` is
901-
either binary or multiclass, :class:`StratifiedKFold` used. In all
902-
other cases, :class:`KFold` is used.
902+
either binary or multiclass,
903+
:class:`sklearn.model_selection.StratifiedKFold` is used. In all
904+
other cases, :class:`sklearn.model_selection.KFold` is used.
903905
904906
Refer :ref:`User Guide <cross_validation>` for the various
905907
cross-validation strategies that can be used here.

sklearn/learning_curve.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ def learning_curve(estimator, X, y, train_sizes=np.linspace(0.1, 1.0, 5),
7575
- An iterable yielding train/test splits.
7676
7777
For integer/None inputs, if the estimator is a classifier and ``y`` is
78-
either binary or multiclass, :class:`StratifiedKFold` used. In all
79-
other cases, :class:`KFold` is used.
78+
either binary or multiclass,
79+
:class:`sklearn.model_selection.StratifiedKFold` is used. In all
80+
other cases, :class:`sklearn.model_selection.KFold` is used.
8081
8182
Refer :ref:`User Guide <cross_validation>` for the various
8283
cross-validation strategies that can be used here.
@@ -288,8 +289,9 @@ def validation_curve(estimator, X, y, param_name, param_range, cv=None,
288289
- An iterable yielding train/test splits.
289290
290291
For integer/None inputs, if the estimator is a classifier and ``y`` is
291-
either binary or multiclass, :class:`StratifiedKFold` used. In all
292-
other cases, :class:`KFold` is used.
292+
either binary or multiclass,
293+
:class:`sklearn.model_selection.StratifiedKFold` is used. In all
294+
other cases, :class:`sklearn.model_selection.KFold` is used.
293295
294296
Refer :ref:`User Guide <cross_validation>` for the various
295297
cross-validation strategies that can be used here.

sklearn/linear_model/ridge.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,8 @@ class RidgeCV(_BaseRidgeCV, RegressorMixin):
11311131
- An iterable yielding train/test splits.
11321132
11331133
For integer/None inputs, if ``y`` is binary or multiclass,
1134-
:class:`StratifiedKFold` used, else, :class:`KFold` is used.
1134+
:class:`sklearn.model_selection.StratifiedKFold` is used, else,
1135+
:class:`sklearn.model_selection.KFold` is used.
11351136
11361137
Refer :ref:`User Guide <cross_validation>` for the various
11371138
cross-validation strategies that can be used here.

sklearn/model_selection/_search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ class GridSearchCV(BaseSearchCV):
706706
- An iterable yielding train, test splits.
707707
708708
For integer/None inputs, if the estimator is a classifier and ``y`` is
709-
either binary or multiclass, :class:`StratifiedKFold` used. In all
709+
either binary or multiclass, :class:`StratifiedKFold` is used. In all
710710
other cases, :class:`KFold` is used.
711711
712712
Refer :ref:`User Guide <cross_validation>` for the various
@@ -962,7 +962,7 @@ class RandomizedSearchCV(BaseSearchCV):
962962
- An iterable yielding train, test splits.
963963
964964
For integer/None inputs, if the estimator is a classifier and ``y`` is
965-
either binary or multiclass, :class:`StratifiedKFold` used. In all
965+
either binary or multiclass, :class:`StratifiedKFold` is used. In all
966966
other cases, :class:`KFold` is used.
967967
968968
Refer :ref:`User Guide <cross_validation>` for the various

sklearn/model_selection/_split.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ def check_cv(cv=3, y=None, classifier=False):
13851385
- An iterable yielding train/test splits.
13861386
13871387
For integer/None inputs, if classifier is True and ``y`` is either
1388-
binary or multiclass, :class:`StratifiedKFold` used. In all other
1388+
binary or multiclass, :class:`StratifiedKFold` is used. In all other
13891389
cases, :class:`KFold` is used.
13901390
13911391
Refer :ref:`User Guide <cross_validation>` for the various

sklearn/model_selection/_validation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def cross_val_score(estimator, X, y=None, labels=None, scoring=None, cv=None,
9898
- An iterable yielding train, test splits.
9999
100100
For integer/None inputs, if the estimator is a classifier and ``y`` is
101-
either binary or multiclass, :class:`StratifiedKFold` used. In all
101+
either binary or multiclass, :class:`StratifiedKFold` is used. In all
102102
other cases, :class:`KFold` is used.
103103
104104
Refer :ref:`User Guide <cross_validation>` for the various
@@ -346,7 +346,7 @@ def cross_val_predict(estimator, X, y=None, labels=None, cv=None, n_jobs=1,
346346
- An iterable yielding train, test splits.
347347
348348
For integer/None inputs, if the estimator is a classifier and ``y`` is
349-
either binary or multiclass, :class:`StratifiedKFold` used. In all
349+
either binary or multiclass, :class:`StratifiedKFold` is used. In all
350350
other cases, :class:`KFold` is used.
351351
352352
Refer :ref:`User Guide <cross_validation>` for the various
@@ -562,7 +562,7 @@ def permutation_test_score(estimator, X, y, labels=None, cv=None,
562562
- An iterable yielding train, test splits.
563563
564564
For integer/None inputs, if the estimator is a classifier and ``y`` is
565-
either binary or multiclass, :class:`StratifiedKFold` used. In all
565+
either binary or multiclass, :class:`StratifiedKFold` is used. In all
566566
other cases, :class:`KFold` is used.
567567
568568
Refer :ref:`User Guide <cross_validation>` for the various
@@ -702,7 +702,7 @@ def learning_curve(estimator, X, y, labels=None,
702702
- An iterable yielding train, test splits.
703703
704704
For integer/None inputs, if the estimator is a classifier and ``y`` is
705-
either binary or multiclass, :class:`StratifiedKFold` used. In all
705+
either binary or multiclass, :class:`StratifiedKFold` is used. In all
706706
other cases, :class:`KFold` is used.
707707
708708
Refer :ref:`User Guide <cross_validation>` for the various
@@ -915,7 +915,7 @@ def validation_curve(estimator, X, y, param_name, param_range, labels=None,
915915
- An iterable yielding train, test splits.
916916
917917
For integer/None inputs, if the estimator is a classifier and ``y`` is
918-
either binary or multiclass, :class:`StratifiedKFold` used. In all
918+
either binary or multiclass, :class:`StratifiedKFold` is used. In all
919919
other cases, :class:`KFold` is used.
920920
921921
Refer :ref:`User Guide <cross_validation>` for the various

0 commit comments

Comments
 (0)