title: How to calculate most important features for Random Forest and Logistic Regression with dummies variables?
body: <p>My df had a lot of categorical variables, so I used</p>
  <p><code>pd.get_dummies()</code></p>
  <p>to be able to train my <code>Random Forest</code> and <code>Logistic Regression</code> models. Everything worked fine, then I asked myself: which components affect the models prediction the most? I thought about using PCA, but I have dummies binary variables, so I don't know if it has interpretability due to the number of variables I have being dummies. I also tried using</p>
  <p><code>RF.feature_importances_</code></p>
  <p>but it's the same; I only have thousands of columns with data where each one influences very little, losing data interpretability. Is there any method to calculate the importance of each variable being dummie? I've seen some discussion on stackoverflow about this. Some say PCA can be used, others say it loses interpretability. I do not look for papers that propose methods. In case there is a solution, I would like it to be implemented in python to use it</p>