Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: unsupported operand type(s) for +: 'NoneType' and 'float' #5

Open
vishpat opened this issue Feb 11, 2017 · 1 comment
Open

Comments

@vishpat
Copy link

vishpat commented Feb 11, 2017

Hit the following exception while using the bayes_logistic module

vpati011@Shlokster:~/Downloads$ python parkisons.py
Traceback (most recent call last):
File "parkisons.py", line 71, in
w_prior, H_prior, solver = 'BFGS')
File "/usr/local/lib/python2.7/dist-packages/bayes_logistic/bayes_logistic.py", line 432, in fit_bayes_logistic
method='BFGS', options={'maxiter': maxiter})
File "/usr/local/lib/python2.7/dist-packages/scipy/optimize/_minimize.py", line 444, in minimize
return _minimize_bfgs(fun, x0, args, jac, callback, **options)
File "/usr/local/lib/python2.7/dist-packages/scipy/optimize/optimize.py", line 913, in _minimize_bfgs
gfk = myfprime(x0)
File "/usr/local/lib/python2.7/dist-packages/scipy/optimize/optimize.py", line 292, in function_wrapper
return function(*(wrapper_args + args))
File "/usr/local/lib/python2.7/dist-packages/bayes_logistic/bayes_logistic.py", line 223, in g_log_posterior_small
grad_log_post = np.dot(X.T, weights * (mu - y)) + np.dot(H, (w - wprior))
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'

The code to reproduce the issue can be found at
http://pastebin.com/KV16bkXt

@mariusvniekerk
Copy link
Collaborator

Can you run this bit with %debug in a notebook and see which part of this is actually None?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants