Hi Team,
I am using this code to run pymc3. I am using python 3.5
pymc_data = df8
init = ols_beta
init['lower'] = (init['beta_values']3).where(init['beta_values'] <0, init['beta_values']-3)
init['upper'] = (init['beta_values']*-3).where(init['beta_values'] <0, init['beta_values']*3)
pymc_data.to_csv(outpath,index = True)
dep_var = ols_var_list_y[0]
indep_var_lst = list(init['name'])
indep_var_str = '+'.join(map(str, indep_var_lst))
formula = dep_var + '~' + indep_var_str
dict = {}
for idx, priors in init.iterrows():
dict[priors['name']] = Uniform.dist(lower=priors['lower'], upper=priors['upper'])
print (dict)
with Model() as model:
glm.GLM(formula, pymc_data, priors=dict)
print ("****************** Processing PYMC3 ************************\n")
with model:
#step = pm.metropolis
start = find_MAP(fmin=opt.fmin_powell)
trace = sample(5000, step = pm.Metropolis(), start=start)
print ('WAIC', waic(trace, model=model))
print ('DIC' , dic(trace, model=model))
print ('BPIC', bpic(trace, model=model))
z = pm.df_summary(trace)
print ("\n ****************** Processed PYMC3*********************\n")
***I am getting the following error,
any_to_tensor_and_labels
raise ValueError(‘Cannot use scalars’)
can you all please help me with what could be the possible source of error?