<p>The paper <a href="https://arxiv.org/abs/1602.04938" rel="noreferrer">
"Why Should I Trust You?": Explaining the Predictions of Any Classifier</a> was submitted 9 days after this question, providing an algorithm for a general solution to this problem! :-)</p>

<p>In short, it is called LIME for "local interpretable model-agnostic explanations", and works by fitting a simpler, local model around the prediction(s) you want to understand.</p>

<p>What's more, they have made a python implementation (<a href="https://github.com/marcotcr/lime" rel="noreferrer">https://github.com/marcotcr/lime</a>) with pretty detailed examples on how to use it with sklearn. For instance <a href="https://marcotcr.github.io/lime/tutorials/Lime%20-%20basic%20usage%2C%20two%20class%20case.html" rel="noreferrer">this one</a> is on two-class random forest problem on text data, and <a href="https://marcotcr.github.io/lime/tutorials/Tutorial%20-%20continuous%20and%20categorical%20features.html" rel="noreferrer">this one</a> is on continuous and categorical features. They are all to be found via the README on github.</p>

<p>The authors had a very productive year in 2016 concerning this field, so if you like reading papers, here's a starter:</p>

<ul>
<li><a href="https://arxiv.org/abs/1611.07579" rel="noreferrer">Programs as Black-Box Explanations</a></li>
<li><a href="https://arxiv.org/abs/1611.05817" rel="noreferrer">Nothing Else Matters: Model-Agnostic Explanations By Identifying Prediction Invariance</a></li>
<li><a href="https://arxiv.org/abs/1606.05386" rel="noreferrer">Model-Agnostic Interpretability of Machine Learning</a></li>
</ul>
Using scikit to determine contributions of each feature to a specific class prediction
<p>I am using a scikit extra trees classifier:</p>

<pre><code>model = ExtraTreesClassifier(n_estimators=10000, n_jobs=-1, random_state=0)
</code></pre>

<p>Once the model is fitted and used to predict classes, I would like to find out the contributions of each feature to a specific class prediction. How do I do that in scikit learn? Is it possible with extra trees classifier or do I need to use some other model?</p>