comparison toolboxes/FullBNT-1.0.7/bnt/examples/static/HME/hme_reg_plot.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 function fh=hme_reg_plot(net, nodes_info, train_data, test_data)
2 %
3 % Use this function ONLY when the input dimension is 1
4 % and the problem is a regression one.
5 % We assume that each row of 'train_data' & 'test_data' is an example.
6 %
7 % ----------------------------------------------------------------------------------------------------
8 % -> pierpaolo_b@hotmail.com or -> pampo@interfree.it
9 % ----------------------------------------------------------------------------------------------------
10
11 fh=figure('Name','HME based regression', 'MenuBar', 'none', 'NumberTitle', 'off');
12
13 mn_x_train = round(min(train_data(:,1)));
14 mx_x_train = round(max(train_data(:,1)));
15 x_train = mn_x_train(1):0.01:mx_x_train(1);
16 Z_train=fhme(net, nodes_info, x_train',size(x_train,2)); % forward propagation trougth the HME
17
18 if nargin==4,
19 subplot(2,1,1);
20 mn_x_test = round(min(test_data(:,1)));
21 mx_x_test = round(max(test_data(:,1)));
22 x_test = mn_x_test(1):0.01:mx_x_test(1);
23 Z_test=fhme(net, nodes_info, x_test',size(x_test,2)); % forward propagation trougth the HME
24 end
25
26 hold on;
27 set(gca, 'Box', 'on');
28 plot(x_train', Z_train, 'r');
29 plot(train_data(:,1),train_data(:,2),'+k');
30 title('Training set and prediction');
31 hold off
32
33 if nargin==4,
34 subplot(2,1,2);
35 hold on;
36 set(gca, 'Box', 'on');
37 plot(x_train', Z_train, 'r');
38 if size(test_data,2)==2,
39 plot(test_data(:,1),test_data(:,2),'+k');
40 end
41 title('Test set and prediction');
42 hold off
43 end