Orange Forum • View topic - Customizable tree classifier

Customizable tree classifier

Discussions about new ideas and features you would like to see in Orange.
(Archived/read-only, please use our ticketing system for your wishes and their discussion.)
Forum rules
(Archived/read-only, please use our ticketing system for your wishes and their discussion.)

Customizable tree classifier

Postby walterj » Tue Nov 29, 2005 0:32

How dificult would it be to add a tree classifier which users could customize? I want to be able to define a penalty function (distribution specific as in GLIM deviance). It would also be nice to be able to experiment with different partitioning strategies. Could a tree system be put together which would support Python code for these operations?

Also, what about a simplex style penalty function minimizer? (As in Nelder-Mead)

Postby Janez » Tue Nov 29, 2005 11:45

The tree classifier in Orange is very versatile, you can just code your new stuff in Python and use it to replace some of the existing components. See the (half finished) documentation at Or, even better, open and find
SplitConstructor_CartesianMeasure. This is an example of something similar to what you want to do.

This however cannot be done directly in the canvas, you will have to use Orange on the scripting level. Canvas wasn't meant for coding; we had a widget where you could enter Python code, but decided against the idea.

Well, if you'd really like to use the modified tree within the canvas, you can copy the tree widget (OrangeWidgets/Classify/ and add your modified code there instead of in a script. Find the method setLearner; you'll see it calls orngTree.TreeLearner with a bunch of arguments. You'll have to add another one, split, to point to your function or class defined like the SplitConstructor_CartesianMeasure above.

If you'd like to compare different partitioning strategies, you'll find it trivial to add another combo box for selection of the strategy to the widget. See

Return to Wish List