<div dir="ltr">The blog post from Matthew Drury sums it up well. The feature importance is indeed the Gini impurity.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 9, 2017 at 8:34 AM, Olga Lyashevska <span dir="ltr"><<a href="mailto:o.lyashevskaya@gmail.com" target="_blank">o.lyashevskaya@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I am trying to understand differences in feature importance plots obtained with R package gbm and sklearn. Having compared both implementation side by side it seems that the models are fairly similar, however feature importance plots are rather distinct.<br>
<br>
R uses empirical improvement in squared error as it is described in Friedmans's "Greedy Function Approximation" paper (eq. 44, 45).<br>
<br>
sklearn (as far as I could see it in the code) uses the weighted reduction in node purity. How exactly is this calculated? Is it a gini index? Is there a reference?<br>
<br>
I found this, but I find this hard to follow:<br>
<a href="https://github.com/scikit-learn/scikit-learn/blob/fc2f24927fc37d7e42917369f17de045b14c59b5/sklearn/tree/_tree.pyx#L1056" rel="noreferrer" target="_blank">https://github.com/scikit-lear<wbr>n/scikit-learn/blob/fc2f24927f<wbr>c37d7e42917369f17de045b14c59b5<wbr>/sklearn/tree/_tree.pyx#L1056</a><br>
<br>
I have also seen a post by Matthew Drury on stack exchange: <a href="https://stats.stackexchange.com/questions/162162/relative-variable-importance-for-boosting" rel="noreferrer" target="_blank">https://stats.stackexchange.co<wbr>m/questions/162162/relative-va<wbr>riable-importance-for-boosting</a><br>
<br>
Many thanks,<br>
Olga<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/scikit-learn</a><br>
</blockquote></div><br></div>