11 2011 档案
摘要:N = 4;dag = zeros( N, N );C = 1; S = 2;R = 3;W = 4;dag( C, [R S] ) = 1;dag( R, W ) = 1;dag( S, W ) = 1;node_sizes = 2*ones(1,N);%node_sizes = [ 4 2 3 5];%建立有向无环图onodes = [];bNet = mk_bnet( dag, node_sizes );%建立条件概率表bNet.CPD{C} = tabular_CPD( bNet, C, 'CPT', [0.5 0.5] );bNet.CPD{R} = tabular_
阅读全文
摘要:# A dictionary of movie critics and their ratings of a small# set of moviesfrom math import sqrtcritics = { 'Lisa Rose': { 'Lady in the Water': 2.5, 'Snakes on a Plane': 3.5,'Just My Luck':3.0, 'Superman Returens':3.5, 'You, Me and Dupree': 2.5,'Th
阅读全文
摘要:#__author__=lx#__date__=2011-11-02def triangle( a, b, c ): if a + b > c and a + c > b and b + c > a : if a != b and a != c and b !=c : print "Ordinary triangle" else : if a == b and a == c: ...
阅读全文