8000 DOC correct indents in docstring _split.py (#15843) · scikit-learn/scikit-learn@64750e5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 64750e5

Browse files
qinhanmin2014glemaitre
authored andcommitted
DOC correct indents in docstring _split.py (#15843)
1 parent 62b1e26 commit 64750e5

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

sklearn/model_selection/_split.py

+33-33
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ class LeaveOneOut(BaseCrossValidator):
135135
>>> print(loo)
136136
LeaveOneOut()
137137
>>> for train_index, test_index in loo.split(X):
138-
... print("TRAIN:", train_index, "TEST:", test_index)
139-
... X_train, X_test = X[train_index], X[test_index]
140-
... y_train, y_test = y[train_index], y[test_index]
141-
... print(X_train, X_test, y_train, y_test)
138+
... print("TRAIN:", train_index, "TEST:", test_index)
139+
... X_train, X_test = X[train_index], X[test_index]
140+
... y_train, y_test = y[train_index], y[test_index]
141+
... print(X_train, X_test, y_train, y_test)
142142
TRAIN: [1] TEST: [0]
143143
[[3 4]] [[1 2]] [2] [1]
144144
TRAIN: [0] TEST: [1]
@@ -222,9 +222,9 @@ class LeavePOut(BaseCrossValidator):
222222
>>> print(lpo)
223223
LeavePOut(p=2)
224224
>>> for train_index, test_index in lpo.split(X):
225-
... print("TRAIN:", train_index, "TEST:", test_index)
226-
... X_train, X_test = X[train_index], X[test_index]
227-
... y_train, y_test = y[train_index], y[test_index]
225+
... print("TRAIN:", train_index, "TEST:", test_index)
226+
... X_train, X_test = X[train_index], X[test_index]
227+
... y_train, y_test = y[train_index], y[test_index]
228228
TRAIN: [2 3] TEST: [0 1]
229229
TRAIN: [1 3] TEST: [0 2]
230230
TRAIN: [1 2] TEST: [0 3]
@@ -398,9 +398,9 @@ class KFold(_BaseKFold):
398398
>>> print(kf)
399399
KFold(n_splits=2, random_state=None, shuffle=False)
400400
>>> for train_index, test_index in kf.split(X):
401-
... print("TRAIN:", train_index, "TEST:", test_index)
402-
... X_train, X 8000 _test = X[train_index], X[test_index]
403-
... y_train, y_test = y[train_index], y[test_index]
401+
... print("TRAIN:", train_index, "TEST:", test_index)
402+
... X_train, X_test = X[train_index], X[test_index]
403+
... y_train, y_test = y[train_index], y[test_index]
404404
TRAIN: [2 3] TEST: [0 1]
405405
TRAIN: [0 1] TEST: [2 3]
406406
@@ -604,9 +604,9 @@ class StratifiedKFold(_BaseKFold):
604604
>>> print(skf)
605605
StratifiedKFold(n_splits=2, random_state=None, shuffle=False)
606606
>>> for train_index, test_index in skf.split(X, y):
607-
... print("TRAIN:", train_index, "TEST:", test_index)
608-
... X_train, X_test = X[train_index], X[test_index]
609-
... y_train, y_test = y[train_index], y[test_index]
607+
... print("TRAIN:", train_index, "TEST:", test_index)
608+
... X_train, X_test = X[train_index], X[test_index]
609+
... y_train, y_test = y[train_index], y[test_index]
610610
TRAIN: [1 3] TEST: [0 2]
611611
TRAIN: [0 2] TEST: [1 3]
612612
@@ -769,9 +769,9 @@ class TimeSeriesSplit(_BaseKFold):
769769
>>> print(tscv)
770770
TimeSeriesSplit(max_train_size=None, n_splits=5)
771771
>>> for train_index, test_index in tscv.split(X):
772-
... print("TRAIN:", train_index, "TEST:", test_index)
773-
... X_train, X_test = X[train_index], X[test_index]
774-
... y_train, y_test = y[train_index], y[test_index]
772+
... print("TRAIN:", train_index, "TEST:", test_index)
773+
... X_train, X_test = X[train_index], X[test_index]
774+
... y_train, y_test = y[train_index], y[test_index]
775775
TRAIN: [0] TEST: [1]
776776
TRAIN: [0 1] TEST: [2]
777777
TRAIN: [0 1 2] TEST: [3]
@@ -861,10 +861,10 @@ class LeaveOneGroupOut(BaseCrossValidator):
861861
>>> print(logo)
862862
LeaveOneGroupOut()
863863
>>> for train_index, test_index in logo.split(X, y, groups):
864-
... print("TRAIN:", train_index, "TEST:", test_index)
865-
... X_train, X_test = X[train_index], X[test_index]
866-
... y_train, y_test = y[train_index], y[test_index]
867-
... print(X_train, X_test, y_train, y_test)
864+
... print("TRAIN:", train_index, "TEST:", test_index)
865+
... X_train, X_test = X[train_index], X[test_index]
866+
... y_train, y_test = y[train_index], y[test_index]
867+
... print(X_train, X_test, y_train, y_test)
868868
TRAIN: [2 3] TEST: [0 1]
869869
[[5 6]
870870
[7 8]] [[1 2]
@@ -980,10 +980,10 @@ class LeavePGroupsOut(BaseCrossValidator):
980980
>>> print(lpgo)
981981
LeavePGroupsOut(n_groups=2)
982982
>>> for train_index, test_index in lpgo.split(X, y, groups):
983-
... print("TRAIN:", train_index, "TEST:", test_index)
984-
... X_train, X_test = X[train_index], X[test_index]
985-
... y_train, y_test = y[train_index], y[test_index]
986-
... print(X_train, X_test, y_train, y_test)
983+
... print("TRAIN:", train_index, "TEST:", test_index)
984+
... X_train, X_test = X[train_index], X[test_index]
985+
... y_train, y_test = y[train_index], y[test_index]
986+
... print(X_train, X_test, y_train, y_test)
987987
TRAIN: [2] TEST: [0 1]
988988
[[5 6]] [[1 2]
989989
[3 4]] [1] [1 2]
@@ -1405,7 +1405,7 @@ class ShuffleSplit(BaseShuffleSplit):
14051405
>>> print(rs)
14061406
ShuffleSplit(n_splits=5, random_state=0, test_size=0.25, train_size=None)
14071407
>>> for train_index, test_index in rs.split(X):
1408-
... print("TRAIN:", train_index, "TEST:", test_index)
1408+
... print("TRAIN:", train_index, "TEST:", test_index)
14091409
TRAIN: [1 3 0 4] TEST: [5 2]
14101410
TRAIN: [4 0 2 5] TEST: [1 3]
14111411
TRAIN: [1 2 4 0] TEST: [3 5]
@@ -1414,7 +1414,7 @@ class ShuffleSplit(BaseShuffleSplit):
14141414
>>> rs = ShuffleSplit(n_splits=5, train_size=0.5, test_size=.25,
14151415
... random_state=0)
14161416
>>> for train_index, test_index in rs.split(X):
1417-
... print("TRAIN:", train_index, "TEST:", test_index)
1417+
... print("TRAIN:", train_index, "TEST:", test_index)
14181418
TRAIN: [1 3 0] TEST: [5 2]
14191419
TRAIN: [4 0 2] TEST: [1 3]
14201420
TRAIN: [1 2 4] TEST: [3 5]
@@ -1508,7 +1508,7 @@ class GroupShuffleSplit(ShuffleSplit):
15081508
>>> gss.get_n_splits()
15091509
2
15101510
>>> for train_idx, test_idx in gss.split(X, y, groups):
1511-
... print("TRAIN:", train_idx, "TEST:", test_idx)
1511+
... print("TRAIN:", train_idx, "TEST:", test_idx)
15121512
TRAIN: [2 3 4 5 6 7] TEST: [0 1]
15131513
TRAIN: [0 1 5 6 7] TEST: [2 3 4]
15141514
'''
@@ -1620,9 +1620,9 @@ class StratifiedShuffleSplit(BaseShuffleSplit):
16201620
>>> print(sss)
16211621
StratifiedShuffleSplit(n_splits=5, random_state=0, ...)
16221622
>>> for train_index, test_index in sss.split(X, y):
1623-
... print("TRAIN:", train_index, "TEST:", test_index)
1624-
... X_train, X_test = X[train_index], X[test_index]
1625-
... y_train, y_test = y[train_index], y[test_index]
1623+
... print("TRAIN:", train_index, "TEST:", test_index)
1624+
... X_train, X_test = X[train_index], X[test_index]
1625+
... y_train, y_test = y[train_index], y[test_index]
16261626
TRAIN: [5 2 3] TEST: [4 1 0]
16271627
TRAIN: [5 1 4] TEST: [0 2 3]
16281628
TRAIN: [5 0 2] TEST: [4 3 1]
@@ -1837,9 +1837,9 @@ class PredefinedSplit(BaseCrossValidator):
18371837
>>> print(ps)
18381838
PredefinedSplit(test_fold=array([ 0, 1, -1, 1]))
18391839
>>> for train_index, test_index in ps.split():
1840-
... print("TRAIN:", train_index, "TEST:", test_index)
1841-
... X_train, X_test = X[train_index], X[test_index]
1842-
... y_train, y_test = y[train_index], y[test_index]
1840+
... print("TRAIN:", train_index, "TEST:", test_index)
1841+
... X_train, X_test = X[train_index], X[test_index]
1842+
... y_train, y_test = y[train_index], y[test_index]
18431843
TRAIN: [1 2 3] TEST: [0]
18441844
TRAIN: [0 2] TEST: [1 3]
18451845
"""

0 commit comments

Comments
 (0)
0