title: Python SKLearn: How to Get Feature Names After OneHotEncoder?
body: <p>I would like to get the feature names of a data set after it has been transformed by SKLearn OneHotEncoder.</p>
  
  <p>In <a href="https://stackoverflow.com/a/33596950">active_features_ attribute in OneHotEncoder</a> one can see a very good explanation how the attributes <code>n_values_</code>, <code>feature_indices_</code> and <code>active_features_</code> get filled after <code>transform()</code> was executed.</p>
  
  <p>My question is: </p>
  
  <p>For e.g. DataFrame based input data:</p>
  
  <pre><code>data = pd.DataFrame({"a": [0, 1, 2,0], "b": [0,1,4, 5], "c":[0,1,4, 5]}).as_matrix()
  </code></pre>
  
  <p>How does the code look like to get from the original feature names <code>a</code>, <code>b</code> and <code>c</code> to a list of the transformed feature names 
  (like e.g:</p>
  
  <p><code>a-0</code>,<code>a-1</code>, <code>a-2</code>, <code>b-0</code>, <code>b-1</code>, <code>b-2</code>, <code>b-3</code>, <code>c-0</code>, <code>c-1</code>, <code>c-2</code>, <code>c-3</code> </p>
  
  <p>or</p>
  
  <p><code>a-0</code>,<code>a-1</code>, <code>a-2</code>, <code>b-0</code>, <code>b-1</code>, <code>b-2</code>, <code>b-3</code>, <code>b-4</code>, <code>b-5</code>, <code>b-6</code>, <code>b-7</code>, <code>b-8</code> </p>
  
  <p>or anything that helps to see the assignment of encoded columns to the original columns).</p>
  
  <p>Background: I would like to see the feature importances of some of the algorithms to get a feeling for which feature have the most effect on the algorithm used.</p>