0
我正在使用pymc3来寻找最适合3D表面。这是我正在使用的代码。IndexError:只有整数,切片(`:`),省略号(`...`)。 。
with Model() as model:
# specify glm and pass in data. The resulting linear model, its likelihood and
# and all its parameters are automatically added to our model.
glm.glm('z ~ x**2 + y**2 + x + y + np.sin(x) + np.cos(y)' , flatimage)
start = find_MAP()
step = NUTS(scaling=start) # Instantiate MCMC sampling algorithm
trace = sample(2000, step, progressbar=False) # draw 2000 posterior samples using NUTS sampling
我在这一行错误:
glm.glm('z ~ x**2 + y**2 + x + y + np.sin(x) + np.cos(y)' , flatimage)
的错误是:
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
我曾试图通过改变罪修复它(X)和cos(Y)到np.sin(x)和np.cos(y),但那不起作用,我不知道该怎么办。
谢谢!这帮助了我! @aloctavodia – VD97