mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-06 02:24:17 +02:00
allowing the passing of 1D X to a GP. with warning of course
This commit is contained in:
parent
68709cfa77
commit
0fa287c044
1 changed files with 4 additions and 1 deletions
|
|
@ -14,8 +14,11 @@ class GPBase(Model):
|
||||||
Here we define some functions that are use
|
Here we define some functions that are use
|
||||||
"""
|
"""
|
||||||
def __init__(self, X, likelihood, kernel, normalize_X=False):
|
def __init__(self, X, likelihood, kernel, normalize_X=False):
|
||||||
|
if len(X.shape)==1:
|
||||||
|
X = X.reshape(-1,1)
|
||||||
|
warning.warn("One dimension output (N,) being reshaped to (N,1)")
|
||||||
self.X = X
|
self.X = X
|
||||||
assert len(self.X.shape) == 2
|
assert len(self.X.shape) == 2, "too many dimensions for X input"
|
||||||
self.num_data, self.input_dim = self.X.shape
|
self.num_data, self.input_dim = self.X.shape
|
||||||
assert isinstance(kernel, kern.kern)
|
assert isinstance(kernel, kern.kern)
|
||||||
self.kern = kernel
|
self.kern = kernel
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue