title: why BernoulliNB classifier returning same value for all data set?
body: <p>I tried using BernoulliNB to predict iris data set. But the trained model returns some random value as prediction for all test data set. I tried the same data set with decision tree where the trained model predicted the test data set with good accuracy.</p>
  
  <pre><code>import pandas as pn
  import sklearn as sk
  from sklearn.model_selection import train_test_split as lk
  
  def labelmod(x):
      if(x =='Iris-versicolor'):
          return 0
      elif(x =='Iris-setosa'):
          return 1
      elif(x =='Iris-virginica'):
          return 3
      else:
          return
  
  def celldif(x):
      return x.apply(labelmod)
  
  ok = pn.read_csv(r"C:\Users\s420105\Desktop\iris.csv",header = None)
  data=ok.dropna()
  labels = data.ix[:,4:]
  labels=labels.apply(celldif)
  data=data.ix[:,0:3]
  train_data,test_data,train_label,test_label=lk(data,labels,test_size=0.3)
  
  from sklearn.naive_bayes import BernoulliNB 
  classifier = BernoulliNB().fit(train_data,train_label.values.ravel())
  result= classifier.predict(test_data)
  result
  </code></pre>
  
  <p>the result returns
  array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=int64) as output</p>
  
  <p>The test and train labels are fine. For decision tree i passed the train_label without including values.ravel()</p>