On Jun 7, 2013, at 11:57 PM, Ken Geis <[email protected]> wrote:

> On May 23, 2013, at 5:03 AM, Gilles Louppe <[email protected]> wrote:
>>> So I'd like to contribute a simple MAE criterion that would be efficient 
>>> for random splits (i.e. O(n) given a single batch update.) Is the direction 
>>> forward for something like this to hard-code more criteria in _tree.pyx, or 
>>> would it be better to approach some modularity and allow a Criterion object 
>>> to be passed in?
>> 
>> At the moment, adding a criterion require writing a new class
>> implementing the Criterion interface defined in _tree.pyx. It should
>> then be pluggable as is without any other change to the code.
> 
> For everyone's information, I'm starting to have success doing this. To pass 
> in my own criterion, I first need to register it like this:
> 
> 
> import sklearn.tree.tree
> 
> class MAE(Criterion):
>       #implementation here
> tree.REGRESSION['mae'] = MAE()
> 
> modeler = ExtraTreesRegressor(criterion='mae', …)
> 

update:

import sklearn.tree.tree

class MAE(RegressionCriterion):
        #implementation here
tree.REGRESSION['mae'] = MAE

modeler = ExtraTreesRegressor(criterion='mae', …)

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to