Skip to content

Commit bc1462c

Browse files
committed
1d caveats
1 parent fee4e18 commit bc1462c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

bambi/backend/pymc.py

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ def _build_common_terms(self, spec):
158158

159159
# Column vector of coefficients and design matrix
160160
coefs = at.concatenate(coefs)
161+
161162
data = np.hstack(columns)
162163

163164
# If there's an intercept, center the data

bambi/backend/terms.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def build(self, spec):
4848
if dims:
4949
coef = distribution(label, dims=dims, **args)
5050
else:
51-
coef = distribution(label, shape=data.shape[1], **args)
51+
shape = None if data.shape[1] == 1 else data.shape
52+
coef = distribution(label, shape=shape, **args)
53+
coef = at.atleast_1d(coef) # If only a single numeric column it wont be 1d
5254

5355
# Prepends one dimension if response is multivariate categorical and predictor is 1d
5456
if response_dims and len(dims) == 1:

0 commit comments

Comments
 (0)