Skip to content

There's a ValueError on EM_demo.py #38

@tiddlerhxy

Description

@tiddlerhxy

hello!
When I ran EM_demo.py, an error occurred,can you tell me what happened?
The following is the wrong report:
Traceback (most recent call last):
File "/root/root/eyes/appone/tt6.py", line 55, in
fitmodel.EM_fit()
File "/usr/local/python3.6.6/lib/python3.6/site-packages/pybasicbayes/abstractions.py", line 221, in EM_fit
return self._EM_fit(self.EM_step,tol=tol,maxiter=maxiter)
File "/usr/local/python3.6.6/lib/python3.6/site-packages/pybasicbayes/abstractions.py", line 206, in _EM_fit
method()
File "/usr/local/python3.6.6/lib/python3.6/site-packages/pybasicbayes/models/mixture.py", line 481, in EM_step
[l.expectations for l in self.labels_list])
File "/usr/local/python3.6.6/lib/python3.6/site-packages/pybasicbayes/distributions/multinomial.py", line 190, in max_likelihood
counts = self._get_weighted_statistics(data,weights)
File "/usr/local/python3.6.6/lib/python3.6/site-packages/pybasicbayes/distributions/multinomial.py", line 140, in _get_weighted_statistics
data = data if data else [None]*len(weights)
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions