title: How to get the number of features from a fitted scikit-learn model?
body: <p>I am trying to extract the number of features from a model after I had fitted this model to my data.</p>
  
  <p>I have looked through the model's directory and found ways to get the number only for specific models (e.g. looking at the dimensions of support vectors for SVM), but I didn't find a general way I could use for any type of a model.</p>
  
  <p>Say I have my dataset of instances and corresponding classes</p>
  
  <pre class="lang-py prettyprint-override"><code>X, y    # dataset
  </code></pre>
  
  <p>and use an arbitrary model from the <code>scikit-learn</code> library to fit this data</p>
  
  <pre class="lang-py prettyprint-override"><code>model.fit(X,y)
  </code></pre>
  
  <p>Later I want to use this model to find the dimensions of the original dataset, something in the way of</p>
  
  <pre><code>model.n_features_
  </code></pre>
  
  <p>Is there a quick and general way to do this?</p>