Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
246 B
3
Indexable
Never
        X_hate = X[Y==1]
        X_non_hate = X[Y==0]

        self.hate_word_prob = (np.sum(X_hate, axis=0)+1)/np.sum(np.sum(X_hate, axis=0))
        self.non_hate_word_prob = (np.sum(X_non_hate, axis=0)+1)/np.sum(np.sum(X_non_hate, axis=0))