Skip to content

Commit 43a0ead

Browse files
authored
added test using adult dataset
1 parent b15d985 commit 43a0ead

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/adult.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Base.Test
2+
using DecisionTree
3+
4+
run(`wget https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data`);
5+
adult = readcsv("adult.data");
6+
7+
features = adult[:, 2:14];
8+
labels = adult[:, 15];
9+
10+
println("\n##### 3 foldCV Classification Tree #####")
11+
accuracy = nfoldCV_tree(labels, features, 0.9, 3);
12+
@test mean(accuracy) > 0.8
13+
14+
println("\n##### 3 foldCV Classification Forest #####")
15+
accuracy = nfoldCV_forest(labels, features, 2, 10, 3, 0.5);
16+
@test mean(accuracy) > 0.8
17+

0 commit comments

Comments
 (0)