-
Notifications
You must be signed in to change notification settings - Fork 584
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
Cannot calculate model.probability() #672
Comments
Same here |
Can confirm that issue as well. Downgrading from 0.12.0 to 0.11.2 solves that ... |
Downgrading solves that, but there another bug... CODE
ERROR
|
Your error appears to be originating from your different datatypes for the assignments. I suggest you to transform all integers (0,1) to strings ('0','1') Thus, it's a different issue than what you stumpled upon initialy |
I would recommend making the input to |
Thanks to @SebastianBelkner, we got the problem for the 0.12 incompatibility: Looking at the v0.11.2 implementation, the array like structure was converted first to a Numpy array and then accessed via def log_probability(self, X, n_jobs=1):
<...>
X = numpy.array(X, ndmin=2)
<...>
for i in range(n):
for j, state in enumerate(self.states):
logp[i] += state.distribution.log_probability(X[i, self.idxs[j]])
return logp if n > 1 else logp[0] The conversion to a Numpy has been removed later. Consequently, the way of accessing values does not work that way. **Converting the 2d-array in advance to a Numpy array as argument for IMHO there are two solutions:
|
I will add the casting as a numpy array back in in the next version. Thanks for catching this and posting a temporary solution. |
It really solved my problem. If you are using Kaggle then, install pomegranate in the first cell using the following command "!pip install pomegranate==0.11.2" |
Passing in a single vector now raises an error. You should pass in a 2D matrix or a list of lists (even when there is only one example). In v0.12.1 |
@jmschrei For current release neither list nor list of lists is working. Is there already some change in source code or example will be updated? |
v0.12.1 will have the fix. I will release that soon. For now, pass in a 2D numpy array and it should work. |
Moving by the tutorial. On Input 7 and 8 got error. Made 0 changes.
pip list
Python 3.6
The text was updated successfully, but these errors were encountered: