feature importance naive bayes python

Solutions on MaxInterview for feature importance naive bayes python by the best coders in the world

showing results for - "feature importance naive bayes python"
Miguel Ángel
16 Sep 2017
1neg_class_prob_sorted = NB_optimal.feature_log_prob_[0, :].argsort()[::-1]
2pos_class_prob_sorted = NB_optimal.feature_log_prob_[1, :].argsort()[::-1]
3
4print(np.take(count_vect.get_feature_names(), neg_class_prob_sorted[:10]))
5print(np.take(count_vect.get_feature_names(), pos_class_prob_sorted[:10]))
6