views:

309

answers:

1

I'm looking for a ID3 decision tree implementation in Python or any languages which takes a validation and a testing file as an input and returns predictions.

I found this and this but I couldn't adapt them to numeric values, e.g. to Iris dataset.

Do you know any ID3 tree implementation that works from console or any written in Python? Or any suggestion how to use this with numeric values will be awesome.

+3  A: 

I have a similar algorithm C4.5 written in python. It work from console. If you are interested I put it here.

Sorry for a post if you need not this.

BTW, I have tested it on Iris data set :)

Update:

I have uploaded both: code and data:

I hope it will help you.

BTW, program also can draw a tree into "png" via graphViz

woo
Yes, I will appreciate if you can share C4.5 algorithm.
Stephen T.
Thanks for the C4.5 code. I need to calculate the accuracy of the classification. How can I get the predictic classes in your code? I tried to use classify(tree_root, ds) but it seems it returns the same class labels as the original -or I'm doing something wrong :)
Stephen T.
Yeah, you are right. Labels are same because learning process are doing on whole iris data set. Just exclude some of data vectors from data file(or do it in 'load_iris' function), and use excluded vectors for testing predicting.
woo