views:

82

answers:

2

What would be a good choice of programming language in which to implement a decision tree? The results of the implementation will be for personal use only, so no need to consider ability to publish etc.

I have heard that Octave is a good option, can anyone explain why a matrix based language is recommended for implementing decision trees?

+3  A: 

I have used Standard ML both to implement decision trees and to write a compiler from a domain-specific language into decision trees. I've also compiled similar decision trees into C code.

It really depends what you want to do with decision trees. If you are trying to do something sophisticated or you are trying to make the decision trees especially easy to read and write, I would suggest either creating a domain-specific language or embedding domain-specific operators into Haskell or Standard ML. If you just want to get going, you could start with ML (easier than Haskell for a beginner) and that preserves some options for later.

In general, ML and Haskell are both very good at representing and manipulating trees of all kinds.

I can't explain why someone would recommend a matrix-based language for decision trees.

Norman Ramsey
Thanks for the information. I guess I was barking up the wrong tree with Octave. I am considering using Python due to this specific article - http://onlamp.com/pub/a/python/2006/02/09/ai_decision_trees.html?page=1- and I've wanted to learn Python for quite some time now, this may be a good start. What do you think?
Shailesh Tainwala
Why are there good for that?I can sketch some response: simplicity, consistency, natural, ... :) But beside the simplicity those language are extremely expressive.There are made to be read.
mathk
+1  A: 

I am pretty sure that the first decision tree was written in LISP.

Still many such algorithm is still written in LISP. You can find many documentation if you decide to choose LISP. Scheme is also a good language for that purpose and it is simpler/smaller than LISP.

Also the learning curve is fast in both languages.

IMHO

mathk