ryanmadden / decision-tree

C4.5 Decision Tree python implementation with validation, pruning, and attribute multi-splitting
81 stars 39 forks source link

decision-tree

A C4.5 Decision Tree python implementation with validation, pruning, and attribute multi-splitting Contributors: Ryan Madden and Ally Cody

Requirements

python 2.7.6 Download

Files

How to run

decision-tree.py accepts parameters passed via the command line. The possible paramters are:

Examples

Example 1
python decision-tree.py btrain.csv -v bvalidate.csv -p -t btest.csv

This command runs decision-tree.py with btrain.csv as the training set, bvalidate.csv as the validation set, btest.csv as the test set, and pruning enabled. The classifier is not specified so it defaults to the last column in the training set. No datatypes file is specified so it defaults to datatypes.csv. Printing is not enabled.

Example 2
python decision-tree.py btrain.csv winner -d datatypes.csv -v bvalidate.csv -p -s

This command runs decision-tree.py with btrain.csv as the training set, 'winner' as the classifier, datatypes.csv as the datatypes file, bvalidate.csv as the validation file, pruning enabled, and printing enabled. Testing is not enabled for this run