espected_bici.m.svn-base

来自「bayesian network structrue learning mat」· SVN-BASE 代码 · 共 30 行

SVN-BASE
30
字号
function BICi = espected_BICi(bnet, i, esc, m, d)% BICi = espected_BIC(bnet, esc, m, nparams)%% INPUTS :%   bnet - the current bayesian network%   esc - the espected counts of the dataset%   m - [optionnal] the number of examples in the dataset%   nparams - dimension of the family of the node i%% OUTPUTS :%   BICi - the espected BIC score of the node i given the dataset%if nargin<4, m = esc{1}; while length(m)>1, m = sum(m); end, endif nargin<5, [D, d] = compute_bnet_nparams(bnet); d = d(i); endtiny = exp(-700);CPT = CPT_from_bnet(bnet);dag = bnet.dag;ns = bnet.node_sizes;N = size(ns,2);cas = ones(1,N);continu = 1;BICi=0;while continu  [p, indice] = compute_prob(dag, ns, CPT, cas);  BICi = BICi + esc{i}(indice(i))*log(CPT{i}(indice(i))+tiny);  [cas, continu] = next_case(cas, ns);  endBICi = BICi-d*log(m)/2;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?