Hi @jeremy, could you please explain what is b in the following code from lesson 5:
x=trn_term_doc
y=trn_y
p = x[y==1].sum(0)+1
q = x[y==0].sum(0)+1
r = np.log((p/p.sum())/(q/q.sum()))
b = np.log(len(p)/len(q)) # what is the meaning of this b?
The b
in the last line is always evaluated to 0 because the len(p) =len(q)
. Isn’t it supposed to be the log ratio of class labels?
Thanks!