I am trying to get the most important features for my GaussianNB model. The codes from here How to get most informative features for scikit-learn classifiers? or here How to get most informative features for scikit-learn classifier for different class? only work when I use MultinomialNB. How can I calculate or retrieve the most important features for each of my two classes (Fault = 1 or Fault = 0) otherwise? My code is: (not applied to text data)
df = df.toPandas()
X = X_df.values
Y = df['FAULT'].values.reshape(-1,1)
gnb = GaussianNB()
y_pred = gnb.fit(X, Y).predict(X)
print(confusion_matrix(Y, y_pred))
print(accuracy_score(Y, y_pred))
Where X_df is a dataframe with binary columns for each of my features.