'ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1,
I've got this error:
ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 1 and
the array at index 1 has size 2
When I use GPR.fit
method, so it would be occurred during concatenation.
But I've been tried it with x and y in same shape,
x.shape = y.shape = (# of rows , )
This is my code:
def interpolate_(x, y, x_fine):
print('shape:',x.shape, y.shape)
gp = GaussianProcessRegressor(kernel = get_combined_kernel())
gp.fit(np.atleast_2d(x).T, y)
y_mean, y_std = gp.predict(x_fine[:,None], return_std=True)
return y_mean
Output of print('shape:', x.shape, y.shape)
:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|