Home / Expert Answers / Computer Science / def-naivebayespy-x-y-34-34-34-naivebayespy-x-y-returns-pos-neg-computation-of-p-y-pa622

(Solved): def naivebayesPY(X, Y): """ naivebayesPY(X, Y) returns [pos,neg] Computation of P(Y) ...



def naivebayesPY(X, Y): """ naivebayesPY(X, Y) returns [pos,neg] Computation of P(Y) Input: X : n input vectors of d dimensions (nxd) Y : n labels (-1 or +1) (nx1) Output: pos: probability p(y=1) neg: probability p(y=-1) """ # add one positive and negative example to avoid division by zero ("plus-one smoothing") Y = np.concatenate([Y, [-1,1]]) n = len(Y) # YOUR CODE HERE raise NotImplementedError()



We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe