title: Getting feature importance in Naive bayes
body: <p>My problem is exactly similar to this, 
  <a href="https://stackoverflow.com/questions/50526898/how-to-get-feature-importance-in-naive-bayes">How to get feature Importance in naive bayes?</a></p>
  
  <p>but when I run the code    </p>
  
  <pre><code>neg_class_prob_sorted = NB_optimal.feature_log_prob_[0, :].argsort()
  pos_class_prob_sorted = NB_optimal.feature_log_prob_[1, :].argsort()
  
  print(np.take(count_vect.get_feature_names(), neg_class_prob_sorted[:10]))
  print(np.take(count_vect.get_feature_names(), pos_class_prob_sorted[:10]))
  </code></pre>
  
  <p>it always prints words with same initials</p>
  
  <pre><code>['aafco' 'misfit' 'misfir' 'miseri' 'miser' 'misconcept' 'miscarriag'
   'misc' 'mirin' 'minuscul']
  ['aafco' 'metrx' 'meticul' 'methood' 'metaplus' 'metaphor' 'mestemach'
   'messiest' 'mesmer' 'mesa']
  </code></pre>
  
  <p>Is there any better way I can print the important features corrosponding to positive and negative class?</p>