Skip to content

Commit abed823

Browse files
m-dzaseyboldt
authored andcommitted
Add dimensionality check for y data in glm (#3570)
1 parent ebb7488 commit abed823

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pymc3/glm/linear.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ class LinearComponent(Model):
3838
def __init__(self, x, y, intercept=True, labels=None,
3939
priors=None, vars=None, name='', model=None, offset=0.):
4040
super().__init__(name, model)
41+
if len(y.shape) > 1:
42+
err_msg = 'Only one-dimensional observed variable objects (i.e.'\
43+
' of shape `(n, )`) are supported'
44+
raise TypeError(err_msg)
4145
if priors is None:
4246
priors = {}
4347
if vars is None:

0 commit comments

Comments
 (0)