You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All the examples so far have worked as expected until chapter 4. In the example Euro.py I'm getting the following error message:
ValueError: Normalize: total probability is zero.
The error is generated because 'H' * heads => 0)0.0, ..., 99) 0.0, 100) 7.504617540403191e-09
and then when I try to process 'T' * tails => the suite is all zeros. Thus, the total is zero.
but I didn't get the same summary values as you did.
I'm all so seeing this same error in with Euro2.py
Environment:
I haveAnaconda 5.0 and VS2017 v15.4.1 installed. I'm running the examples from within VS, but VS is running the code from within Anaconda 5.0.0 (global Default)
Also, I'm getting the same error when I run it inside of the jupyter notebook
dataset = 'H' * 140 + 'T' * 110
suite = Euro(range(0, 101))
dataset = 'H' * 140 + 'T' * 110
for data in dataset:
suite.Update(data)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-3-a0973cb6b830> in <module>()
3
4 for data in dataset:
----> 5 suite.Update(data)
C:\Dev\Repos\ThinkBayes2\code\thinkbayes2.py in Update(self, data)
1410 like = self.Likelihood(data, hypo)
1411 self.Mult(hypo, like)
-> 1412 return self.Normalize()
1413
1414 def LogUpdate(self, data):
C:\Dev\Repos\ThinkBayes2\code\thinkbayes2.py in Normalize(self, fraction)
532 total = self.Total()
533 if total == 0:
--> 534 raise ValueError('Normalize: total probability is zero.')
535
536 factor = fraction / total
ValueError: Normalize: total probability is zero.
Hope this helps.
The text was updated successfully, but these errors were encountered:
All the examples so far have worked as expected until chapter 4. In the example Euro.py I'm getting the following error message:
The error is generated because 'H' * heads => 0)0.0, ..., 99) 0.0, 100) 7.504617540403191e-09
and then when I try to process 'T' * tails => the suite is all zeros. Thus, the total is zero.
I was able to fix this issue by change this code
to
but I didn't get the same summary values as you did.
I'm all so seeing this same error in with Euro2.py
Environment:
I haveAnaconda 5.0 and VS2017 v15.4.1 installed. I'm running the examples from within VS, but VS is running the code from within Anaconda 5.0.0 (global Default)
Also, I'm getting the same error when I run it inside of the jupyter notebook
Hope this helps.
The text was updated successfully, but these errors were encountered: