bernoulli-probability

Look up BernoulliNB Probability in Dataframe

蹲街弑〆低调 提交于 2019-12-11 17:22:09
问题 I have some training data (TRAIN) and some test data (TEST). Each row of each dataframe contains an observed class (X) and some columns of binary (Y). BernoulliNB predicts the probability of X given Y in the test data based on the training data. I am trying to look up the probability of the observed class of each row in the test data (Pr). Edit: I used Antoine Zambelli's advice to fix the code: from sklearn.naive_bayes import BernoulliNB BNB = BernoulliNB() # Training Data TRAIN = pd