title: How to get the feature importance in Gaussian Naive Bayes
body: <p>I have a <code>Gaussian</code> <code>naive bayes</code> algorithm running against a dataset. What I need is to to get the feature importance (impactfulness of the features) on the target class.</p>
  <p>Here's my code:</p>
  <pre><code>from sklearn.naive_bayes import GaussianNB
  from sklearn.metrics import accuracy_score
  from sklearn.model_selection import train_test_split
  
  X_train, X_test, y_train, y_test = train_test_split(inputs, target, test_size=0.2)
  
  gaussian_nb = GaussianNB()
  </code></pre>
  <pre><code>gaussian_nb.fit(X_train, y_train)
  </code></pre>
  <pre><code>gaussian_nb.score(X_test, y_test)*100
  </code></pre>
  <p>And I tried:</p>
  <pre><code>importance = gaussian_nb.coefs_ # and even tried coef_
  </code></pre>
  <p>and it gives an error:</p>
  <blockquote>
  <p>AttributeError: 'GaussianNB' object has no attribute 'coefs_'</p>
  </blockquote>
  <p>Can someone please help me?</p>