亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? lungbayesdemo.html

?? 關于醫學診斷系統matlab實現 v 關于醫學診斷系統matlab實現
?? HTML
?? 第 1 頁 / 共 4 頁
字號:
set(gca,'xticklabel',{'With Bronchitis','Without Bronchitis'},'yticklabel', {'Smoking','Lung Cancer'});
title('Conditional probabilities with evidence of abnormal x-ray results')
view(50,35);

%%
% When bronchitis is ruled out (|B = f|), the probability of smoking
% history decreases with respect to the case in which the
% bronchitis is confirmed (|B = t|). The effect is propagated across the
% network and affects the probability of lung cancer in a similar manner.


%% Expanding the Network 
% Among various symptoms related to lung cancer and bronchitis is shortness
% of breath (dyspnea). We want to model the relationship of this condition
% within the considered Bayesian Network. We introduce a node |D| and modify
% the adjacency matrix accordingly.

%=== add node D to the network
D = 5;
CPT{D}(:,:,t) = [.75 .1; .5 .05];
CPT{D}(:,:,f) = 1 - CPT{D}(:,:,t);
values{D} =  [1 2];
adj(end+1,:) = [0 0 0 0];
adj(:,end+1) = [0 1 1 0 0];

%=== draw the updated network 
nodeLabels = {'Smoking', 'Bronchitis', 'Lung Cancer', 'Xrays', 'Dyspnea'};
nodeSymbols = {'S', 'B', 'L', 'X', 'D'};
bg = biograph(adj, nodeLabels, 'arrowsize', 4);
nodeHandles= bg.Nodes;
set(nodeHandles, 'shape', 'ellipse');
view(bg)
   
%%
% With the introduction of node |D|, the network is not singly-connected
% anymore. In fact, there are more than one chain between any two nodes
% (i.e., |S| and |D|). We can check this property by considering the undirected
% graph associated with the network and veryfying that it is not acyclic.

isAcyclic = graphisdag(sparse(adj | adj'))

%%
% In order to use the algorithm for exact inference described above, we
% must transform the new, multiply-connected network into a singly-connected
% network. Several approaches can be used, including clustering of parent
% nodes (in our case |B| and |L|) into a single node as follows. 
% 
% First, we combine the adjacency matrix entries corresponding to the nodes
% |B| and |L| into one entry associated to node |BL|. The node |BL| can take up to
% four values, corresponding to all possible combinations of values of the
% original nodes |B| and |L|. Then, we update the conditional probability
% distribution considering that |B| and |L| are conditionally independent given
% the node |S|, that is P(BL|S) = P(B,L|S) = P(B|S) * P(L|S).

%=== combine B and L
adj(B,:) = adj(B,:) | adj(L,:); 
adj(:,B) = adj(:,B) | adj(:,L);
adj(L,:) = []; adj(:,L) = [];   

%=== update the probability distribution accordingly
b1 = kron(CPT{B}(1,:), CPT{L}(1,:));  
b2 = kron(CPT{B}(2,:), CPT{L}(2,:));
x = [CPT{X}(1,:) CPT{X}(1,:)];
d =  reshape((CPT{D}(:,:,1))', 1, 4);

%=== update the node values
S = 1; BL = 2; X = 3; D = 4; 
nodeNames = {'S', 'BL', 'X', 'D'}; 
tt = 1; tf = 2; ft = 3; ff = 4;
values{BL} = 1:4; 
values(L) = [];

%=== create a clustered Conditional Probability Table
cCPT{S} = CPT{S}; 
cCPT{BL}(t,:) = b1; cCPT{BL}(f,:) = b2;
cCPT{D}(:,t) = d; cCPT{D}(:,f) = 1 - d;
cCPT{X}(:,t) = x; cCPT{X}(:,f) = 1 - x;

%=== create and intiate the net
root = find(sum(adj,1)==0); % root (node with no parent)
[cNodes, cEdges] = bnMsgPassCreate(adj, values, cCPT);
[cNodes, cEdges] = bnMsgPassInitiate(cNodes, cEdges, root);

for i = 1:n
    disp(['P(' nodeNames{i}, '|[]) = ' num2str(cNodes(i).P(1))]);
end

%% Drawing the Expanded Network

%=== draw the network
nodeLabels = {'Smoking', 'Bronchitis or Lung Cancer', 'Abnormal X-rays', 'Dyspnea'};
cbg = biograph(adj, nodeNames, 'arrowsize', 4);
set(cbg.Nodes, 'shape', 'ellipse');
cbgInViewer = view(cbg);

%=== assign relevant info to each node handle
cnodeHandles = cbgInViewer.Nodes;
for i = 1:n
    cnodeHandles(i).UserData.Distribution = [cNodes(i).P];
end

%=== draw customized nodes
set(cnodeHandles, 'shape','circle')
colormap(summer)
cbgInViewer.ShowTextInNodes = 'none';
cbgInViewer.CustomNodeDrawFcn = @(node) customnodedraw(node);
cbgInViewer.Scale = .7
cbgInViewer.dolayout



%% Performing Exact Inference on Clustered Trees
% Suppose a patient complains of dyspnea (|D=t|). We would
% like to evaluate the likelihood that this symptom is related to either
% lung cancer or bronchitis.

[n5, e5, A5, a5] = bnMsgPassUpdate(cNodes, cEdges, [], [], D, t);

%%
% Because node |B| and node |L| are clustered into the node |BL|, we have to
% calculate their individual conditional probabilities by considering the
% appropriate value combinations. The conditional probabilities
% in |BL| correspond to the following |B| and |L| value combinations: |BL = tt| if
% |B = t| and |L = t|; |BL = tf| if |B = t| and |L = f|; |BL = ft| if |B = f| and |L = t|; |BL
% = ff| if |B = f| and |L = f|. Therefore P(B|evidence) is equal to the sum of
% the first two elements of P(BL|evidence), and similarly, P(L|evidence) is
% equal to the sum of the first and third elements in P(BL|evidence).

p(1,:) = n5(S).P; 
p(2,:) = [sum(n5(BL).P([tt,tf])), 1-sum(n5(BL).P([tt,tf]))];     % P(B|evidence)
p(3,:) = [sum(n5(BL).P([tt,ft])), 1-sum(n5(BL).P([tt,ft]))]; % P(L|evidence)
p(4,:) = n5(X).P;
p(5,:) = n5(D).P;

for i = 1:5
    disp(['P(' nodeSymbols{i}, '|D=t) = ' num2str(p(i,1))]);
end
%%
% When dyspnea is present, both the likelihood of bronchitis and lung cancer
% increase. This makes sense, since both illnesses have dyspnea as
% symptom and the patient is  indeed exhibiting this symptom.

%% Explaining Away the Lung Cancer
% As we can see in the graph, the
% dyspnea symptom has dependency both on bronchitis and lung cancer.
% Consider the effect of a bronchitis diagnosis on the likelihood of lung
% cancer.

%=== adjust the CPT to reflect B = 1 before clustering into BL node
B = 2; L = 3; 
CPT{B}(:,1) = [1 1] ; CPT{B}(:,2) = 1 - CPT{B}(:,1);
b1 = kron(CPT{B}(1,:), CPT{L}(1,:));  
b2 = kron(CPT{B}(2,:), CPT{L}(2,:));

%=== create a clustered Conditional Probability Table
BL = 2;  
cCPT{BL}(1,:) = b1; cCPT{BL}(2,:) = b2;

%=== create and intiate the net
root = find(sum(adj,1)==0); % root (node with no parent)
[cNodes, cEdges] = bnMsgPassCreate(adj, values, cCPT);
[cNodes, cEdges] = bnMsgPassInitiate(cNodes, cEdges, root);

%=== instantiate for F = 1
[n7, e7, A7, a7] = bnMsgPassUpdate(cNodes, cEdges, [], [], D, t);
w(1,:) = n7(S).P;
w(2,:) = [sum(n7(BL).P([tt,tf])), 1-sum(n7(BL).P([tt,tf]))];     % P(B|evidence)
w(3,:) = [sum(n7(BL).P([tt,ft])), 1-sum(n7(BL).P([tt,ft]))]; % P(L|evidence)
w(4,:) = n7(X).P;
w(5,:) = n7(D).P;

for i = 1:5
    disp(['P(' nodeSymbols{i}, '|B=t,D=t) = ' num2str(w(i,1))]);
end

%%
% When a patient complains of dyspnea and is diagnosed with bronchitis, the
% conditional probability of lung cancer is lower.
% 
% Consider now the effect of a lung cancer diagnosis on the likellihood of
% bronchitis.

%=== adjust the CPT to reflect L = 1 before clustering into BL node
B = 2; L = 3; 
CPT{B}(:,t) = [.25 .05] ; CPT{B}(:,f) = 1 - CPT{B}(:,t);
CPT{L}(:,t) = [1 1]; CPT{L}(:,f) = 1 - CPT{L}(:,t);

b1 = kron(CPT{B}(t,:), CPT{L}(t,:));  
b2 = kron(CPT{B}(f,:), CPT{L}(f,:));

BL = 2;  
cCPT{BL}(t,:) = b1; cCPT{BL}(f,:) = b2;

%=== create and intiate the net
root = find(sum(adj,1)==0); % root (node with no parent)
[cNodes, cEdges] = bnMsgPassCreate(adj, values, cCPT);
[cNodes, cEdges] = bnMsgPassInitiate(cNodes, cEdges, root);

%=== instantiate for D = 1
[n8, e8, A8, a8] = bnMsgPassUpdate(cNodes, cEdges, [], [], D, t);
v(1,:) = n8(S).P;
v(2,:) = [sum(n8(BL).P([tt,tf])), 1-sum(n8(BL).P([tt,tf]))];     % P(B|evidence)
v(3,:) = [sum(n8(BL).P([tt,ft])), 1-sum(n8(BL).P([tt,ft]))]; % P(L|evidence)
v(4,:) = n8(X).P;
v(5,:) = n8(D).P;

for i = 1:5
    disp(['P(' nodeSymbols{i}, '|L=t,D=t) = ' num2str(v(i,1))]);
end

%%
% If a patient is diagnosed with lung cancer in presence of
% dyspnea, the likelihood of bronchitis decreases significantly.
% This phenomenon is called "explaining away" and refers to the situations
% in which the chances of one cause decrease significantly when the chances
% of the competing cause increase. 

%%
% We can observe the "explaining away" phenomenon in the two situations
% described above by comparing the conditional probabilities of node |L| and
% |B| in the two cases. When the evidence for |B| is high, the likelihood
% of |L| is relatively low, and viceversa, when the evidence for |L| is high, the
% likelihood of |B| is low. 

y = [w(2:3,1)  v(2:3,1)];
figure();
bar(y);
set(gca, 'xticklabel', {'Bronchitis', 'Lung Cancer'});
ylabel('Probability'); title('Explaining away with evidence of dyspnea')
legend('B = t', 'L = t', 'location', 'SouthEastOutside');
colormap(summer)

%% References
% [1] Pearl J., "Probabilistic Reasoning in Intelligent Systems", Morgan
% Kaufmann, San Mateo, California, 1988.
%
% [2] Neapolitan R., "Learning Bayesian Networks", Pearson Prentice Hall,
% Upper Saddle River, New Jersey, 2004.


##### SOURCE END #####-->   </body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线精品视频一区二区三四 | 国产精品网站在线| 91免费看片在线观看| 欧美国产一区二区在线观看| 国内精品伊人久久久久av影院 | 国产乱码精品一品二品| 久久丝袜美腿综合| 国产经典欧美精品| 国产精品久久久久久久久免费相片 | 亚洲18影院在线观看| 日韩精品自拍偷拍| 国产在线观看一区二区| 国产精品免费人成网站| 色婷婷精品久久二区二区蜜臀av| 一区二区三区中文在线观看| 欧美日本精品一区二区三区| 九九精品视频在线看| 中文字幕 久热精品 视频在线| 91精品国产麻豆| 久久婷婷成人综合色| 中文字幕一区二区不卡| 亚洲成人免费观看| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲高清不卡在线观看| 亚洲一区二区视频在线| 免费在线看成人av| 国产一区欧美日韩| 91在线国产福利| 99精品欧美一区二区三区小说 | 久久久国产精品麻豆| 久久一日本道色综合| 亚洲老司机在线| 看国产成人h片视频| 久久精品国产免费| 成人在线视频一区二区| 欧美精品日韩综合在线| 中文字幕亚洲精品在线观看| 26uuu国产在线精品一区二区| 2019国产精品| 亚洲午夜日本在线观看| 亚洲电影视频在线| 国产综合久久久久影院| 91老司机福利 在线| 51久久夜色精品国产麻豆| 日韩一区二区三区av| 成人欧美一区二区三区在线播放| 韩国女主播一区二区三区| 91.com视频| 亚洲蜜臀av乱码久久精品蜜桃| 国产91精品入口| 91精品国产欧美一区二区18| 国产亚洲欧美日韩日本| 亚洲18色成人| 91麻豆精品国产自产在线| 国产黄色精品视频| 欧美日韩的一区二区| 美女网站色91| 亚洲精品福利视频网站| 国产日韩av一区二区| 日韩欧美国产综合一区 | 欧美中文字幕一区| 成人免费高清视频| 国产乱码一区二区三区| 秋霞影院一区二区| 亚洲国产精品自拍| 一区二区三区四区蜜桃 | 136国产福利精品导航| 国产网站一区二区| 久久久久久久久蜜桃| 欧美大肚乱孕交hd孕妇| 7777女厕盗摄久久久| 777欧美精品| 欧美一级搡bbbb搡bbbb| 91精品国产一区二区三区| 欧美日韩国产综合视频在线观看| 色94色欧美sute亚洲线路一ni| 成人一区在线观看| 亚洲一区二三区| 色天天综合久久久久综合片| 国产高清久久久| 国产精品一区二区免费不卡| 韩日欧美一区二区三区| 狠狠v欧美v日韩v亚洲ⅴ| 韩国女主播成人在线| 国产精品夜夜嗨| 丰满白嫩尤物一区二区| 99re成人精品视频| 在线一区二区三区| 欧美日高清视频| 日韩精品一区二区三区三区免费 | 精品美女被调教视频大全网站| 日韩区在线观看| 久久免费视频色| 国产精品久久久久久久裸模| 亚洲免费观看视频| 亚洲成人福利片| 琪琪久久久久日韩精品| 精品亚洲porn| 成人免费观看男女羞羞视频| 91麻豆福利精品推荐| 欧美日韩黄视频| 日韩三级中文字幕| 国产精品人妖ts系列视频| 亚洲欧美一区二区三区国产精品 | 欧美人妇做爰xxxⅹ性高电影| 日韩视频在线永久播放| 欧美—级在线免费片| 一区二区在线免费| 秋霞成人午夜伦在线观看| 国产黄色精品网站| 在线看日韩精品电影| 精品精品国产高清a毛片牛牛 | 亚洲日本在线视频观看| 婷婷国产在线综合| 国产一本一道久久香蕉| 91在线无精精品入口| 日韩一区二区三| 最近中文字幕一区二区三区| 日韩有码一区二区三区| 国产91丝袜在线播放九色| 欧美中文字幕一区| 国产日产欧美精品一区二区三区| 亚洲激情第一区| 国模套图日韩精品一区二区| 色噜噜偷拍精品综合在线| 日韩欧美亚洲一区二区| 亚洲女人小视频在线观看| 免费一级欧美片在线观看| 94-欧美-setu| 久久午夜羞羞影院免费观看| 亚洲综合色成人| 国产成人精品免费一区二区| 欧美丰满嫩嫩电影| 亚洲三级在线免费| 狠狠色丁香九九婷婷综合五月| 欧亚洲嫩模精品一区三区| 国产亚洲精久久久久久| 蜜臀91精品一区二区三区| 色婷婷综合久久| 国产亚洲精品aa| 久久精品久久99精品久久| 在线观看日韩电影| 国产精品成人一区二区艾草| 捆绑调教美女网站视频一区| 欧美色图12p| 一区二区三区91| av一区二区三区| 中文字幕高清不卡| 黑人巨大精品欧美黑白配亚洲| 欧美精品乱码久久久久久| 一区二区三区毛片| 99久久er热在这里只有精品15| 26uuu精品一区二区| 久久国产尿小便嘘嘘尿| 5月丁香婷婷综合| 亚洲成人av免费| 色激情天天射综合网| 17c精品麻豆一区二区免费| 风间由美一区二区三区在线观看| 欧美成人福利视频| 久久成人免费电影| 日韩精品一区二区三区在线| 秋霞国产午夜精品免费视频| 在线成人高清不卡| 日韩成人免费电影| 在线不卡中文字幕播放| 日韩av高清在线观看| 色吧成人激情小说| 91美女在线看| 成人深夜视频在线观看| 麻豆精品一区二区av白丝在线| 《视频一区视频二区| 6080日韩午夜伦伦午夜伦| 91在线视频播放地址| 国产伦精品一区二区三区在线观看| 国产精品成人免费精品自在线观看| 欧美一区二区在线播放| 欧美精品在线观看播放| 成人app在线| 1区2区3区国产精品| 欧美自拍偷拍一区| 亚洲大尺度视频在线观看| 欧美日韩不卡一区| 久久国产精品色婷婷| 26uuu国产电影一区二区| 国产精品一区二区在线观看不卡| 久久久久久久久久久久久夜| 国产夫妻精品视频| 亚洲色大成网站www久久九九| 欧日韩精品视频| 欧美aaaaaa午夜精品| 2014亚洲片线观看视频免费| 国产91综合网| 亚洲影院理伦片| 精品国产乱码久久久久久免费 | 日本一区二区在线不卡| 色综合久久久网| 日韩综合小视频| 26uuu久久综合| 91免费看`日韩一区二区|