@@ -1373,11 +1373,12 @@ def test_center_kernel():
13731373 K_pred_centered2 = centerer .transform (K_pred )
13741374 assert_array_almost_equal (K_pred_centered , K_pred_centered2 )
13751375
1376+
13761377def 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
13781379 value. Use precomputed kernel to ensure Pipeline with KernelCenterer
13791380 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 ]])
13811382 y_true = np .ones ((4 ,))
13821383 K = X .dot (X .T )
13831384 kcent = KernelCenterer ()
@@ -1389,7 +1390,7 @@ def test_cv_pipeline_precomputed():
13891390 # test cross-validation, score should be almost perfect
13901391 # NB: this test is pretty vacuous -- it's mainly to test integration
13911392 # 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 )
13931394 assert_array_almost_equal (y_true , y_pred )
13941395
13951396
0 commit comments