8000 Fix tests on numpy master (#8355) · sergeyf/scikit-learn@aba9cdf · GitHub
[go: up one dir, main page]

Skip to content

Commit aba9cdf

Browse files
lestevesergeyf
authored andcommitted
Fix tests on numpy master (scikit-learn#8355)
numpy.apply_along_axis has changed behaviour when the function passed in returns a 2d array
1 parent 215edc7 commit aba9cdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklearn/gaussian_process/kernels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ def diag(self, X):
18521852
Diagonal of kernel k(X, X)
18531853
"""
18541854
# We have to fall back to slow way of computing diagonal
1855-
return np.apply_along_axis(self, 1, X)[:, 0]
1855+
return np.apply_along_axis(self, 1, X).ravel()
18561856

18571857
def is_stationary(self):
18581858
"""Returns whether the kernel is stationary. """

0 commit comments

Comments
 (0)
0