def test_tree(train_examples, test_examples): tree = learn_tree(train_data.features, train_data.class_vals, funct, train_examples) return classify_all(tree, test_examples)
def evaluate(tree, test_set): return id3.classify_all(tree, test_set)/len(test_set)
def evaluate(tree, test_set): return id3.classify_all(tree, test_set) / len(test_set)