Issue 'ValueError: operands could not be broadcast together with shapes (2,3,1) (3,1,3) ' #1500
Unanswered
joshuapeters0210
asked this question in
Q&A
Replies: 2 comments 1 reply
-
@joshuapeters0210 It's hard to say without looking at the rest of your code but the first thing I would check is that the variables used for query and evidence exist in the learned model and also that the state names exist in the CPD. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Basically I wish to set some evidence in my BN ie (if this node was this, and this node was this what would be the updated cpds).
I can't find a decent way to do this, whenever I try to use
infer_non_adjust = VariableElimination(macid)
print(infer_non_adjust.query(variables=["UD"], evidence={"UI": 'No'}))
I get the following error.
'ValueError: operands could not be broadcast together with shapes (2,3,1) (3,1,3) '
However on a test project I did it worked fine, as far as I can tell there isnt too much difference between the two codes.
My questions are, what could be causing this issue and is there an alternate way to find this information out.
As a point this is my first time using python, im not particulary good with this and this is simply for data analysis of other work, so sorry if I struggle with the basics (i'm trying to learn)
Beta Was this translation helpful? Give feedback.
All reactions