[scikit-learn] custom loss function in RandomForestRegressor
tevang3 at gmail.com
Thu Feb 15 14:46:31 EST 2018
Is it possible to compile just _criterion.pyx and _criterion.pxd files by
using "importpyx" or any alternative way instead of compiling the whole
sklearn library every time I introduce a change?
Dne 15. 2. 2018 19:29 napsal uživatel "Guillaume Lemaitre" <
g.lemaitre58 at gmail.com>:
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)
@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.
INRIA Saclay Ile-de-France / Equipe PARIETAL
guillaume.lemaitre at inria.fr - https://glemaitre.github.io/
*From: *Thomas Evangelidis
*Sent: *Thursday, 15 February 2018 19:15
*To: *Scikit-learn mailing list
*Reply To: *Scikit-learn mailing list
*Subject: *Re: [scikit-learn] custom loss function in RandomForestRegressor
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.
class Criterion is an Interface, doesn't have function definitions. By
"writing your own criterion with a given loss" you mean writing a class
On 15 February 2018 at 18:50, Guillaume Lemaître <g.lemaitre58 at gmail.com>
> The ClassificationCriterion and RegressionCriterion are now exposed in the
> _criterion.pxd. It will allow you to create your own criterion.
> So you can write your own Criterion with a given loss by implementing the
> methods which are required in the trees.
> Then you can pass an instance of this criterion to the tree and it should
> Guillaume Lemaitre
> INRIA Saclay - Parietal team
> Center for Data Science Paris-Saclay
> scikit-learn mailing list
> scikit-learn at python.org
Dr Thomas Evangelidis
CEITEC - Central European Institute of Technology
62500 Brno, Czech Republic
email: tevang at pharm.uoa.gr
tevang3 at gmail.com
scikit-learn mailing list
scikit-learn at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the scikit-learn