@@ -162,7 +162,7 @@ Example of 2-fold::
162
162
sklearn.cross_validation.KFold(n=4, n_folds=2)
163
163
164
164
>>> for train, test in kf:
165
- ... print(train, test)
165
+ ... print("%s %s" % ( train, test) )
166
166
[False False True True] [ True True False False]
167
167
[ True True False False] [False False True True]
168
168
@@ -181,7 +181,7 @@ when creating the cross-validation procedure::
181
181
182
182
>>> kf = KFold(len(Y), n_folds=2, indices=True)
183
183
>>> for train, test in kf:
184
- ... print(train, test)
184
+ ... print("%s %s" % ( train, test) )
185
185
[2 3] [0 1]
186
186
[0 1] [2 3]
187
187
@@ -210,7 +210,7 @@ Example of stratified 2-fold::
210
210
sklearn.cross_validation.StratifiedKFold(labels=[0 0 0 1 1 1 0], n_folds=2)
211
211
212
212
>>> for train, test in skf:
213
- ... print(train, test)
213
+ ... print("%s %s" % ( train, test) )
214
214
[1 4 6] [0 2 3 5]
215
215
[0 2 3 5] [1 4 6]
216
216
@@ -233,7 +233,7 @@ not waste much data as only one sample is removed from the learning set::
233
233
sklearn.cross_validation.LeaveOneOut(n=4)
234
234
235
235
>>> for train, test in loo:
236
- ... print(train, test)
236
+ ... print("%s %s" % ( train, test) )
237
237
[1 2 3] [0]
238
238
[0 2 3] [1]
239
239
[0 1 3] [2]
@@ -257,7 +257,7 @@ Example of Leave-2-Out::
257
257
sklearn.cross_validation.LeavePOut(n=4, p=2)
258
258
259
259
>>> for train, test in lpo:
260
- ... print(train, test)
260
+ ... print("%s %s" % ( train, test) )
261
261
[2 3] [0 1]
262
262
[1 3] [0 2]
263
263
[1 2] [0 3]
@@ -291,7 +291,7 @@ a training set using the samples of all the experiments except one::
291
291
sklearn.cross_validation.LeaveOneLabelOut(labels=[1, 1, 2, 2])
292
292
293
293
>>> for train, test in lolo:
294
- ... print(train, test)
294
+ ... print("%s %s" % ( train, test) )
295
295
[2 3] [0 1]
296
296
[0 1] [2 3]
297
297
@@ -318,7 +318,7 @@ Example of Leave-2-Label Out::
318
318
sklearn.cross_validation.LeavePLabelOut(labels=[1, 1, 2, 2, 3, 3], p=2)
319
319
320
320
>>> for train, test in lplo:
321
- ... print(train, test)
321
+ ... print("%s %s" % ( train, test) )
322
322
[4 5] [0 1 2 3]
323
323
[2 3] [0 1 4 5]
324
324
[0 1] [2 3 4 5]
@@ -348,7 +348,7 @@ Here is a usage example::
348
348
ShuffleSplit(5, n_iter=3, test_size=0.25, indices=True, ...)
349
349
350
350
>>> for train_index, test_index in ss:
351
- ... print(train_index, test_index)
351
+ ... print("%s %s" % ( train_index, test_index) )
352
352
...
353
353
[1 3 4] [2 0]
354
354
[1 4 3] [0 2]
@@ -394,7 +394,7 @@ smaller than the total dataset if it is very large.
394
394
Bootstrap(9, n_iter=3, train_size=5, test_size=4, random_state=0)
395
395
396
396
>>> for train_index, test_index in bs:
397
- ... print (train_index, test_index)
397
+ ... print (" %s %s " % ( train_index, test_index) )
398
398
...
399
399
[1 8 7 7 8] [0 3 0 5]
400
400
[5 4 2 4 2] [6 7 1 0]
0 commit comments