Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/examples/static/dtree/test_zoo1.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 % Here the training data is adapted from UCI ML repository, 'zoo' data | |
2 | |
3 dtreeCPD=tree_CPD; | |
4 | |
5 % load data | |
6 fname = fullfile(BNT_HOME, 'examples', 'static', 'uci_data', 'zoo', 'zoo1.data') | |
7 data=load(fname); | |
8 data=data'; | |
9 | |
10 data=transform_data_into_bnt_format(data, []); | |
11 | |
12 % learn decision tree from data | |
13 ns=2*ones(1,17); | |
14 ns(13)=6; | |
15 ns(17)=7; | |
16 dtreeCPD1=learn_params(dtreeCPD,1:17,data,ns,[],'stop_cases',5); % a node with less than 5 cases will not be splitted | |
17 | |
18 % evaluate on data | |
19 [score,outputs]=evaluate_tree_performance(dtreeCPD1,1:17,data,ns,[]); | |
20 fprintf('Accuracy in old training data %6.3f\n',score); | |
21 |