<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Yes, but if you write it in Python, not Cython, it will be
unbearably slow.<br>
<br>
<div class="moz-cite-prefix">On 02/15/2018 12:37 PM, Thomas
Evangelidis wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAACvdx1Z81mJXOpgR4wGXaH5HNxMdAXbLeobungtM5Q4R2T8Vg@mail.gmail.com">
<div dir="ltr">
<div class="gmail_default"
style="font-size:large;color:rgb(0,0,0)">Greetings,<br>
<br>
</div>
<div class="gmail_default"
style="font-size:large;color:rgb(0,0,0)">The feature
importance calculated by the RandomForest implementation is a
very useful feature. I personally use it to select the best
features because it is simple and fast, and then I train
MLPRegressors. The limitation of this approach is that
although I can control the loss function of the MLPRegressor
(I have modified scikit-learn's implementation to accept an
arbitrary loss function), I cannot do the same with
RandomForestRegressor, and hence I have to rely on 'mse' which
is not in accordance with the loss functions I use in MLPs.
Today I was looking at the _criterion.pyx file:<br>
<br>
<a
href="https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_criterion.pyx"
moz-do-not-send="true">https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_criterion.pyx</a><br>
<br>
</div>
<div class="gmail_default"
style="font-size:large;color:rgb(0,0,0)">However, the code is
in Cython and I find it hard to follow. I know that for
Regression the relevant class are Criterion(),
RegressionCriterion(Criterion), and MSE(RegressionCriterion).
My question is: is it possible to write a class that takes an
arbitrary function "loss(predictions, targets)" to calculate
the loss and impurity of the nodes? <br>
<br>
</div>
<div class="gmail_default"
style="font-size:large;color:rgb(0,0,0)">thanks,<br>
</div>
<div class="gmail_default"
style="font-size:large;color:rgb(0,0,0)">Thomas<br clear="all">
</div>
<br>
<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"
moz-do-not-send="true">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"
moz-do-not-send="true">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/"
moz-do-not-send="true">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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
scikit-learn mailing list
<a class="moz-txt-link-abbreviated" href="mailto:scikit-learn@python.org">scikit-learn@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/scikit-learn">https://mail.python.org/mailman/listinfo/scikit-learn</a>
</pre>
</blockquote>
<br>
</body>
</html>