about summary refs log tree commit diff
path: root/sourcecodes/parameter_learning/getParams.m
blob: 31f84ffba634d7102f40b606d4f57c63dea80eef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function [ bnet ] = getParams( bnet, cases )
%getParams Code to initialize CPT and do parameter learning.
%This will be very basic for now.  I can add more options later.

dnodes = bnet.dnodes;
cnodes = bnet.cnodes;
nnodes = size(dnodes,2)+size(cnodes,2);

%make dnodes tabular_CPT
for i = 1:size(dnodes,2)
    bnet.CPD{dnodes(i)} = tabular_CPD(bnet,dnodes(i));
end

for i = 1:size(cnodes,2)
    bnet.CPD{cnodes(i)} = gaussian_CPD(bnet,cnodes(i));
end

bnet = learn_params(bnet,cases);


end