While learning about Naive Bayes Classification I encountered a problem with bayespost function. When I rewrited this function in my jupyter notebook I got following error
AssertionError: Argument data must have NDArray type, but got ...
I wanted to fix this and change two lines in this function
def bayespost(data):
logpost = logpy.copy()
logpost += (logpx * x + logpxneg * (1 - x)).sum(0)
logpost -= nd.max(logpost)
post = nd.exp(logpost) # before was: post = nd.exp(logpost).asnumpy()
post /= nd.sum(post)
return post.asnumpy() # before was: post
I am also curious if only I got this error
While learning about Naive Bayes Classification I encountered a problem with
bayespostfunction. When I rewrited this function in my jupyter notebook I got following errorI wanted to fix this and change two lines in this function
I am also curious if only I got this error