<div dir="auto"><div>Hi Sebastian, <div dir="auto"><br></div><div dir="auto">Going back to Pearson's R loss function, does this imply that I must add an abstract "init2" method to RegressionCriterion (that's where MSE class inherits from) where I will add the target values X as extra argument? And then the node impurity will be 1-R (the lowest the best)? What about the impurities of the left and right split? In MSE class they are (sum_i^n y_i)**2 where n is the number of samples in the respective split. It is not clear how this is related to variance in order to adapt it for my purpose. </div><div dir="auto"><br></div><div dir="auto">Best, </div><div dir="auto">Thomas</div><br><div class="gmail_extra"><br><div class="gmail_quote">On Mar 1, 2018 14:56, "Sebastian Raschka" <<a href="mailto:se.raschka@gmail.com">se.raschka@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, Thomas,<br>
<br>
in regression trees, minimizing the variance among the target values is equivalent to minimizing the MSE between targets and predicted values. This is also called variance reduction: <a href="https://en.wikipedia.org/wiki/Decision_tree_learning#Variance_reduction" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/<wbr>Decision_tree_learning#<wbr>Variance_reduction</a><br>
<br>
Best,<br>
Sebastian<br>
<div class="elided-text"><br>
> On Mar 1, 2018, at 8:27 AM, Thomas Evangelidis <<a href="mailto:tevang3@gmail.com">tevang3@gmail.com</a>> wrote:<br>
><br>
><br>
> Hi again,<br>
><br>
> I am currently revisiting this problem after familiarizing myself with Cython and Scikit-Learn's code and I have a very important query:<br>
><br>
> Looking at the class MSE(RegressionCriterion), the node impurity is defined as the variance of the target values Y on that node. The predictions X are nowhere involved in the computations. This contradicts my notion of "loss function", which quantifies the discrepancy between predicted and target values. Am I looking at the wrong class or what I want to do is just not feasible with Random Forests? For example, I would like to modify the RandomForestRegressor code to minimize the Pearson's R between predicted and target values.<br>
><br>
> I thank you in advance for any clarification.<br>
> Thomas<br>
><br>
><br>
><br>
><br>
> On 02/15/2018 01:28 PM, Guillaume Lemaitre wrote:<br>
>> Yes you are right pxd are the header and pyx the definition. You need to write a class as MSE. Criterion is an abstract class or base class (I don't have it under the eye)<br>
>><br>
>> @Andy: if I recall the PR, we made the classes public to enable such custom criterion. However, ‎it is not documented since we were not officially supporting it. So this is an hidden feature. We could always discuss to make this feature more visible and document it.<br>
><br>
><br>
><br>
><br>
><br>
> --<br>
> ==============================<wbr>==============================<wbr>==========<br>
> Dr Thomas Evangelidis<br>
> Post-doctoral Researcher<br>
> CEITEC - Central European Institute of Technology<br>
> Masaryk University<br>
> Kamenice 5/A35/2S049,<br>
> 62500 Brno, Czech Republic<br>
><br>
> email: <a href="mailto:tevang@pharm.uoa.gr">tevang@pharm.uoa.gr</a><br>
>               <a href="mailto:tevang3@gmail.com">tevang3@gmail.com</a><br>
><br>
> website: <a href="https://sites.google.com/site/thomasevangelidishomepage/" rel="noreferrer" target="_blank">https://sites.google.com/site/<wbr>thomasevangelidishomepage/</a><br>
><br>
><br>
</div><div class="elided-text">> ______________________________<wbr>_________________<br>
> scikit-learn mailing list<br>
> <a href="mailto:scikit-learn@python.org">scikit-learn@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/scikit-learn</a><br>
<br>
______________________________<wbr>_________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/scikit-learn</a><br>
</div></blockquote></div><br></div></div></div>