<html><head></head><body lang="en-GB" style="background-color: rgb(255, 255, 255); line-height: initial;">                                                                                      <div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">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)</div><div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br></div><div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">@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. </div>                                                                                                                                     <div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br></div>                                                                                                                                                                                                   <div style="font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">Guillaume Lemaitre <br>INRIA Saclay Ile-de-France / Equipe PARIETAL<br>guillaume.lemaitre@inria.fr - https://glemaitre.github.io/</div>                                                                                                                                                                                  <table width="100%" style="background-color:white;border-spacing:0px;"> <tbody><tr><td colspan="2" style="font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);">                           <div style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in; font-family: Tahoma, 'BB Alpha Sans', 'Slate Pro'; font-size: 10pt;">  <div><b>From: </b>Thomas Evangelidis</div><div><b>Sent: </b>Thursday, 15 February 2018 19:15</div><div><b>To: </b>Scikit-learn mailing list</div><div><b>Reply To: </b>Scikit-learn mailing list</div><div><b>Subject: </b>Re: [scikit-learn] custom loss function in RandomForestRegressor</div></div></td></tr></tbody></table><div style="border-style: solid none none; border-top-color: rgb(186, 188, 209); border-top-width: 1pt; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"></div><br><div id="_originalContent" style=""><div dir="ltr"><div class="gmail_default" style="font-size:large;color:rgb(0,0,0)">Sorry I don't know Cython at all. _criterion.pxd is like the header file in C++? I see that it contains class, function and variable definitions and their description in comments.<br><br>class Criterion is an Interface, doesn't have function definitions. By "writing your own criterion with a given loss" you mean writing a class like MSE(RegressionCriterion)?<br> <br></div><div class="gmail_extra"><br><div class="gmail_quote">On 15 February 2018 at 18:50, Guillaume Lemaître <span dir="ltr"><<a href="mailto:g.lemaitre58@gmail.com" target="_blank">g.lemaitre58@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>The ClassificationCriterion and RegressionCriterion are now exposed in the _criterion.pxd. It will allow you to create your own criterion.<br></div>So you can write your own Criterion with a given loss by implementing the methods which are required in the trees.<br></div>Then you can pass an instance of this criterion to the tree and it should work.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><br></div><span class="gmail-HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div class="gmail-m_5866208828338211687gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Guillaume Lemaitre<br>INRIA Saclay - Parietal team<br>Center for Data Science Paris-Saclay<br><a href="https://glemaitre.github.io/" target="_blank">https://glemaitre.github.io/</a></div></div></div></div></div></div></div>
</font></span></div>
<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>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div>                                <p style="margin-bottom:0cm" align="LEFT"><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif"><font size="2">======================================================================</font></span></span></p>
<p style="margin-bottom:0cm" align="LEFT"><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif"><font size="2">Dr Thomas Evangelidis</font></span></span></p>
<p style="margin-bottom:0cm" align="LEFT"><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif"><font size="2">Post-doctoral Researcher<br></font></span></span></p><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif"><font size="2">CEITEC - Central European Institute of Technology<br>Masaryk University<br>Kamenice 5/A35/2S049, <br>62500 Brno, Czech Republic <br></font></span></span></div><div dir="ltr"><span style="color:rgb(0,0,0)"><br></span><p style="margin-bottom:0cm" align="LEFT"><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif"><font size="2">email: <a href="mailto:tevang@pharm.uoa.gr" target="_blank">tevang@pharm.uoa.gr</a></font></span></span></p>
<p style="margin-bottom:0cm" align="LEFT"><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif"><font size="2">            <a href="mailto:tevang3@gmail.com" target="_blank">tevang3@gmail.com</a></font></span></span></p>
<p style="margin-bottom:0cm" align="LEFT"><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif"><font size="2"><br>website: <a href="https://sites.google.com/site/thomasevangelidishomepage/" target="_blank">https://sites.google.com/site/thomasevangelidishomepage/</a></font></span></span></p><span style="color:rgb(0,0,0)"><br></span><p style="margin-bottom:0cm" align="LEFT">
</p>
</div></div></div></div></div></div></div></div>
</div></div>
<br><!--end of _originalContent --></div></body></html>