Mercurial > hg > camir-ismir2012
diff toolboxes/FullBNT-1.0.7/bnt/examples/static/dtree/test_zoo1.m @ 0:cc4b1211e677 tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author | Daniel Wolff |
---|---|
date | Fri, 19 Aug 2016 13:07:06 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toolboxes/FullBNT-1.0.7/bnt/examples/static/dtree/test_zoo1.m Fri Aug 19 13:07:06 2016 +0200 @@ -0,0 +1,21 @@ +% Here the training data is adapted from UCI ML repository, 'zoo' data + +dtreeCPD=tree_CPD; + +% load data +fname = fullfile(BNT_HOME, 'examples', 'static', 'uci_data', 'zoo', 'zoo1.data') +data=load(fname); +data=data'; + +data=transform_data_into_bnt_format(data, []); + +% learn decision tree from data +ns=2*ones(1,17); +ns(13)=6; +ns(17)=7; +dtreeCPD1=learn_params(dtreeCPD,1:17,data,ns,[],'stop_cases',5); % a node with less than 5 cases will not be splitted + +% evaluate on data +[score,outputs]=evaluate_tree_performance(dtreeCPD1,1:17,data,ns,[]); +fprintf('Accuracy in old training data %6.3f\n',score); +