Package teamwork :: Package test :: Package math :: Module testID3
[hide private]
[frames] | no frames]

Module testID3

source code

Functions [hide private]
 
get_file()
Tries to extract a filename from the command line.
source code
 
run_test(fin)
This function creates a list of exmaples data (used to learn the d-tree) and a list of samples (for classification by the d-tree) from the designated file.
source code
 
print_tree(tree, prefix='')
This function recursively crawls through the d-tree and prints it out in a more readable format than a straight print of the Python dict object.
source code
Function Details [hide private]

get_file()

source code 

Tries to extract a filename from the command line. If none is present, it prompts the user for a filename and tries to open the file. If the file exists, it returns it, otherwise it prints an error message and ends execution.

run_test(fin)

source code 

This function creates a list of exmaples data (used to learn the d-tree) and a list of samples (for classification by the d-tree) from the designated file. It then creates the d-tree and uses it to classify the samples. It prints the classification of each record in the samples list and returns the d-tree.