@@ -1373,11 +1373,12 @@ def test_center_kernel():
1373
1373
K_pred_centered2 = centerer .transform (K_pred )
1374
1374
assert_array_almost_equal (K_pred_centered , K_pred_centered2 )
1375
1375
1376
+
1376
1377
def test_cv_pipeline_precomputed ():
1377
- """Cross-validate a regression on four coplanar points with the same
1378
+ """Cross-validate a regression on four coplanar points with the same
1378
1379
value. Use precomputed kernel to ensure Pipeline with KernelCenterer
1379
1380
is treated as a _pairwise operation."""
1380
- X = np .array ([[3 ,0 , 0 ],[0 ,3 , 0 ],[0 ,0 , 3 ],[1 ,1 , 1 ]])
1381
+ X = np .array ([[3 , 0 , 0 ], [0 , 3 , 0 ], [0 , 0 , 3 ], [1 , 1 , 1 ]])
1381
1382
y_true = np .ones ((4 ,))
1382
1383
K = X .dot (X .T )
1383
1384
kcent = KernelCenterer ()
@@ -1389,7 +1390,7 @@ def test_cv_pipeline_precomputed():
1389
1390
# test cross-validation, score should be almost perfect
1390
1391
# NB: this test is pretty vacuous -- it's mainly to test integration
1391
1392
# of Pipeline and KernelCenterer
1392
- y_pred = cross_val_predict (pipeline ,K , y_true ,cv = 4 )
1393
+ y_pred = cross_val_predict (pipeline , K , y_true , cv = 4 )
1393
1394
assert_array_almost_equal (y_true , y_pred )
1394
1395
1395
1396
0 commit comments