Question: def naivebayesPY ( X , Y ) : naivebayesPY ( X , Y ) returns [ pos , neg ] Computation of
def naivebayesPYX Y:
naivebayesPYX Y returns posneg
Computation of PY
Input:
X : n input vectors of d dimensions nxd
Y : n labels or nx
Output:
pos: probability py
neg: probability py
# add one positive and negative example to avoid division by zero plusone smoothing"
Y npconcatenateY
n lenY
# YOUR CODE HERE
raise NotImplementedError
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
