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

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

?? lungbayesdemo.html

?? 關于醫學診斷系統matlab實現 v 關于醫學診斷系統matlab實現
?? HTML
?? 第 1 頁 / 共 4 頁
字號:
</pre><img vspace="5" hspace="5" src="lungbayesdemo_09.png"> <h2>References<a name="27"></a></h2>         <p>[1] Pearl J., "Probabilistic Reasoning in Intelligent Systems", Morgan Kaufmann, San Mateo, California, 1988.</p>         <p>[2] Neapolitan R., "Learning Bayesian Networks", Pearson Prentice Hall, Upper Saddle River, New Jersey, 2004.</p>         <p class="footer"><br>            Published with MATLAB&reg; 7.6<br></p>      </div>      <!--##### SOURCE BEGIN #####%% Modeling Lung Cancer Diagnosis Using Bayesian Network Inference
% This demo illustrates a simple Bayesian Network example for exact
% probabilistic inference using Pearl's message-passing algorithm. 

%% Introduction
% Bayesian networks (or belief networks) are probabilistic graphical models
% representing a set of variables and their dependencies.
% The graphical nature of Bayesian networks and the ability of describing
% uncertainty of complex relationships in a compact manner provide a method
% for modelling almost any type of data.

%%
% Consider the following example, representing a simplified model to help
% diagnose the patients arriving at a respiratory clinic. A history of smoking
% has a direct influence on both whether or not a patient has bronchitis
% and whether or not a patient has lung cancer. In turn, the presence or
% absence of lung cancer has direct influence on the results of a chest
% x-ray test. We are interested in doing probabilistic inference involving
% features that are not directly related, and for which the conditional
% probability cannot be readily computed using a simple application of the
% Bayes' theorem.

%% Creating the Bayesian Network 
% A Bayesian network consists of a direct-acyclic graph (DAG) in which
% every node represents a variable and every edge represents a dependency
% between variables. We construct this graph by specifying an adjacency
% matrix where the element on row _i_ and column _j_ contains the number of
% edges directed from node _i_ to node _j_. The variables of the models are
% specified by the graph's nodes: |S| (smoking history), |B| (bronchitis),
% |L| (lung cancer) and |X| (chest x-ray). The variables are discrete and
% can take only two values: true (|t|) or false (|f|). 

%=== setup
adj = [0 1 1 0; 0 0 0 0; 0 0 0 1; 0 0 0 0]; % adjacency matrix
nodeNames = {'S', 'B', 'L', 'X'};           % nodes 
S = 1; B = 2; L = 3; X = 4;                 % node identifiers
n = numel(nodeNames);                       % number of nodes
t = 1; f  = 2;                              % true and false
values = cell(1,n);                         % values assumed by variables
for i = 1:numel(nodeNames)
    values{i} = [t f];                      
end

%%
% In addition to the graph structure, we need to specify the
% parameters of the model, namely the conditional probability
% distribution. For discrete variables, this distribution can be
% represented as a table (Conditional Probability Table, |CPT|), which lists
% the probability that a node takes on each of its value, given the value
% combinations of its parents.

%=== Conditional Probability Table
CPT{S} = [.2 .8];
CPT{B}(:,t) = [.25 .05] ; CPT{B}(:,f) = 1 - CPT{B}(:,t);
% CPT{L}(:,t) = [.03 .0005]; CPT{L}(:,f) = 1 - CPT{L}(:,t);
CPT{L}(:,t) = [.3 .005]; CPT{L}(:,f) = 1 - CPT{L}(:,t);
CPT{X}(:,t) = [.6 .02]; CPT{X}(:,f) = 1 - CPT{X}(:,t);

%% Visualizing the Bayesian Network as a Graph
% We can visualize the network structure using the |biograph|
% object. The properties of nodes and edges can be changed as
% desidered.

%=== draw the network
nodeLabels = {'Smoking', 'Bronchitis', 'Lung Cancer', 'Abnormal Xrays'};
bg = biograph(adj, nodeLabels, 'arrowsize', 4);
set(bg.Nodes, 'shape', 'ellipse');
bgInViewer = view(bg);

%=== save as figure
bgFig = figure;
copyobj(bgInViewer.hgAxes,bgFig)

%=== annotate using the CPT
[xp, xn] = find(adj);     % xp = parent id, xn = node id
pa(xn) = xp;              % parents
pa(1) = 1;                % root is parent of itself

s1 = cell(1,n); s2 = cell(1,n); pos = zeros(n,2);
for i = 2:n
    pos(i,:) = bgInViewer.Nodes(i).Position;
    s1{i} = sprintf('P(%s|%s=t) = %f', nodeNames{i}, nodeNames{pa(i)}, CPT{i}(1,t));
    s2{i} = sprintf('P(%s|%s=f) = %f', nodeNames{i}, nodeNames{pa(i)}, CPT{i}(2,t));
end

pos(1,:) = bgInViewer.Nodes(1).Position; % root
s1{1} = sprintf('P(%s=t) = %f', nodeNames{1}, CPT{1}(1));
s2{1} = ' ';

text(pos(:,1)+2, pos(:,2)-10, s1)
text(pos(:,1)+2, pos(:,2)-15, s2)


%% Initializing the Bayesian Network
% The process of computing the probability distribution of variables given
% specific evidence is called probabilistic inference. By exploiting local
% independencies among nodes, Pearls [1] developed a message-passing algorithm
% for exact inference in singly-connected networks. The algorithm can
% compute the conditional probability of any variable given any set of
% evidence by propagation of beliefs between neighboring nodes. For more
% information about the message-passing algorithm see [2].
% We can create and initiate a Bayesian network for the example under
% consideration as follows:

root = find(sum(adj,1)==0); % root is any node with no parent
[nodes, edges] = bnMsgPassCreate(adj, values, CPT);
[nodes, edges] = bnMsgPassInitiate(nodes, edges, root)

%%
% The algorithm parameters, including the conditional probability of each
% node given the evidence, are stored in the fields of the MATLAB structures
% |nodes| and |edges|. Using the function |customnodedraw|, we can
% visualize the distribution of the conditional probability given an empty
% set of evidence in a series of pie charts, as shown below. 

%=== conditional probability given the empty set []
for i = 1:n
    disp(['P(' nodeNames{i}, '|[]) = ' num2str(nodes(i).P(1))]);
end

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

%=== draw customized nodes
bgInViewer.ShowTextInNodes = 'none';

set(nodeHandles, 'shape','circle')
bgInViewer.CustomNodeDrawFcn = @(node) customnodedraw(node);
%bgInViewer.Scale = .7
bgInViewer.dolayout


%%
% Suppose we are interested in evaluating the likelihood that a patient
% with bronchitis has lung cancer. We instantiate |B=t| (true) and we
% update the network as follows:

%=== inference with B = t
evNode = B; 
evValue = t;
[n1, e1, A1, a1] = bnMsgPassUpdate(nodes, edges, [], [], evNode, evValue);

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

%== plot and compare
figure(); subplot(2,1,1); 
x = cat(1,nodes.P);
bar(x, 'stacked'); set(gca, 'xticklabel', nodeNames);
ylabel('Probability');
title('Initialized network with empty evidence set')
legend({'true', 'false'}, 'location', 'SouthEastOutside')
hold on; subplot(2,1,2);
x1 = cat(1,n1.P); 
bar(x1, 'stacked'); set(gca, 'xticklabel', nodeNames);
ylabel('Probability');
title('Updated network with evidence B=true')
legend({'true', 'false'}, 'location', 'SouthEastOutside')

%%
% With the observation that the patient has bronchitis (|B = t|), the probability of
% a true condition for all other nodes has increased. In particular, the
% probability of smoking history increases because smoking is one leading
% cause of chronic bronchitis. In turn, because smoking is also associated
% with lung cancer, the probability of lung cancer increases and so does the
% probability of an abnormal chest x-ray test.

%% 
% Suppose the patient has not been evaluated for bronchitis but the chest
% x-ray shows some abnormalities. We instantiate |X = t| and we
% intialize again the network with the new evidence.

evNode = X; 
evValue = t;
[n2, e2, A2, a2] = bnMsgPassUpdate(nodes, edges, [], [], evNode, evValue);

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

%% 
% Given the observed abnormal x-ray results, the probability of lung cancer
% has increased significantly because of the direct dependency of node |X| (x-rays) on
% node |L| (lung cancer).

%%
% Finally, suppose the patient has both been diagnosed with bronchitis and
% received positive results for his/her chest x-ray. We update the previous
% state of the network (|X| = |t|) with the new evidence(|B| = |t|), as shown below: 

evNode = B; 
evValue = t;
[n3, e3, A3, a3] = bnMsgPassUpdate(n2, e2, A2, a2, evNode, evValue);

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

%%
% We can compare the three situations by plotting the probabilities as bar
% charts. Evidence of bronchitis and evidence of abnormal x-rays increase
% the probability of lung cancer and smoking history, one indirectly and
% the other directly.

figure(); subplot(3,1,1); 
bar(x1,  'stacked'); set(gca, 'xticklabel', nodeNames);
ylabel('Probability'); title('Bronchitis diagnosis');
legend({'true', 'false'}, 'location', 'SouthEastOutside')
hold on; subplot(3,1,2);
x2 = cat(1,n2.P);
bar(x2,'stacked'); set(gca, 'xticklabel', nodeNames);
ylabel('Probability'); title('Abnormal x-rays');
legend({'true', 'false'}, 'location', 'SouthEastOutside')
hold on; subplot(3,1,3);
x3 = cat(1,n3.P);
bar(x3, 'stacked'); set(gca, 'xticklabel', nodeNames);
ylabel('Probability'); title('Bronchitis and abnormal x-ray');
legend({'true', 'false'}, 'location', 'SouthEastOutside')
%%
% We can now compare the effect of a positive versus negative bronchitis
% diagnosis in presence of abnormal x-ray results. We instantiate |B = f|
% (false) and compare with previous estimates |B = t| (true).

evNode = B; 
evValue = f;
[n4, e4, A4, a4] = bnMsgPassUpdate(n2, e2, [], [], evNode, evValue);

for i = 1:n
    disp(['P(' nodeNames{i}, '|B=f,X=t) = ' num2str(n4(i).P(1))]);
end

figure();
bar3([n3(S).P(:,t) n4(S).P(:,t); n3(L).P(:,t) n4(L).P(:,t)]);
colormap(summer); zlabel('Probability'); 
set(gca,'xticklabel',{'Smoking','Lung Cancer'},'yticklabel', {'With Bronchitis', 'Without Bronchitis'});

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品三级电影| 欧美一区二区日韩一区二区| 久久婷婷国产综合精品青草| 狠狠网亚洲精品| 亚洲va国产va欧美va观看| 欧美性受极品xxxx喷水| 亚洲自拍偷拍综合| 欧美日韩免费一区二区三区| 亚洲成人激情自拍| 精品免费日韩av| 粉嫩蜜臀av国产精品网站| 中文字幕一区日韩精品欧美| 日本高清无吗v一区| 日本vs亚洲vs韩国一区三区| 国产亚洲一二三区| 色狠狠桃花综合| 日本不卡123| ●精品国产综合乱码久久久久| av资源网一区| 麻豆国产欧美日韩综合精品二区 | 亚洲欧美日韩国产另类专区 | 欧美日本在线看| 国产成+人+日韩+欧美+亚洲| 亚洲人一二三区| 日韩欧美国产一区二区三区| 成人av影院在线| 免费看日韩精品| 亚洲嫩草精品久久| 久久无码av三级| 欧美丰满嫩嫩电影| www.欧美色图| 不卡视频一二三| 日本欧美久久久久免费播放网| 亚洲天堂2016| 国产精品女上位| 久久伊人中文字幕| 精品福利一二区| 欧美一区二区三区系列电影| av日韩在线网站| 成人福利视频网站| 国产精品123| 丁香婷婷综合五月| 国产精品综合av一区二区国产馆| 亚洲一区二区三区四区在线观看| 国产欧美一区二区三区网站| 亚洲一区二区三区视频在线| 一区二区三区高清| 亚洲一区二区综合| 午夜精品久久久久久久蜜桃app| 亚洲欧美国产三级| 亚洲一区二区三区四区在线免费观看| 亚洲欧洲日韩一区二区三区| 亚洲欧美日韩国产中文在线| 亚洲另类春色校园小说| 亚洲精品菠萝久久久久久久| 亚洲黄色性网站| 一区二区三区四区精品在线视频| 夜夜嗨av一区二区三区中文字幕 | 久久美女高清视频| 亚洲国产精品成人综合| 亚洲麻豆国产自偷在线| 亚洲高清免费观看| 国产精品一级二级三级| 成人黄页在线观看| 91精品国产高清一区二区三区 | 亚洲丝袜美腿综合| 免费在线观看视频一区| 成人精品电影在线观看| 欧美精品丝袜中出| 成人欧美一区二区三区黑人麻豆| 亚洲超碰97人人做人人爱| 国产麻豆一精品一av一免费| 91成人网在线| 中文字幕欧美激情| 老司机精品视频导航| 色成人在线视频| 久久久九九九九| 日韩和欧美一区二区三区| 99久久99久久久精品齐齐| 日韩精品中文字幕一区二区三区| 一色桃子久久精品亚洲| 国产传媒欧美日韩成人| 91精品国产综合久久精品性色| 国产精品久久久久久福利一牛影视 | 色猫猫国产区一区二在线视频| 精品国产免费久久| 黄页网站大全一区二区| 91精品午夜视频| 亚洲二区在线观看| 欧美午夜精品久久久| 亚洲女与黑人做爰| 99久久免费精品| 国产精品色哟哟| www.日韩在线| 一区二区三区在线不卡| 色综合久久中文综合久久97| 亚洲精品videosex极品| 在线精品视频一区二区| 亚洲国产成人va在线观看天堂| 欧美日韩精品三区| 男女性色大片免费观看一区二区 | 国产精品成人免费在线| 色综合天天做天天爱| 一区二区三区小说| 精品国产髙清在线看国产毛片| 免费成人美女在线观看| 久久久午夜电影| 色婷婷综合久色| 午夜精品成人在线| 久久久久久日产精品| 91麻豆精东视频| 琪琪久久久久日韩精品| 亚洲国产精品ⅴa在线观看| 欧美午夜片在线看| 国产精品中文欧美| 亚洲二区在线观看| 国产精品乱码久久久久久| 欧美人狂配大交3d怪物一区| 高清shemale亚洲人妖| 午夜激情综合网| 日韩码欧中文字| 久久久91精品国产一区二区三区| 色偷偷久久人人79超碰人人澡| 秋霞电影一区二区| 一区二区三区国产| 中文字幕欧美日韩一区| 欧美一区二区三区喷汁尤物| 91亚洲资源网| 国产成人av电影免费在线观看| 亚洲午夜电影在线观看| 国产精品第四页| 中文字幕欧美国产| 国产日产欧产精品推荐色| 日韩一区二区免费电影| 欧美日韩国产综合久久| 欧洲一区二区av| 欧美日本在线观看| 67194成人在线观看| 欧美日韩国产色站一区二区三区| 97久久精品人人做人人爽| 成人免费av资源| 成人动漫一区二区三区| 不卡视频免费播放| 色综合天天综合| 欧美亚洲综合另类| 欧美男生操女生| 欧美一级久久久久久久大片| 欧美一区二区三区婷婷月色| 欧美精品亚洲一区二区在线播放| 欧美天堂一区二区三区| 欧美日韩你懂的| 精品剧情v国产在线观看在线| 精品欧美黑人一区二区三区| www久久精品| 中文字幕va一区二区三区| 亚洲色图在线看| 午夜电影久久久| 国产成人免费在线视频| 色噜噜狠狠成人中文综合| 欧美老肥妇做.爰bbww视频| 在线成人av网站| 国产欧美日本一区视频| 亚洲视频在线观看三级| 日韩成人一区二区三区在线观看| 国产在线不卡一区| 99国产精品久久久| 欧美成人一级视频| 亚洲一卡二卡三卡四卡无卡久久 | 精品一区二区三区在线观看国产 | 成人av影视在线观看| 欧美日韩精品免费| 中文字幕一区二区三区在线观看 | 欧美制服丝袜第一页| 国产日韩欧美麻豆| 麻豆精品国产传媒mv男同| 99riav久久精品riav| 国产色产综合产在线视频| 亚洲午夜精品网| 91网站在线播放| 欧美高清在线精品一区| 精品一区二区三区香蕉蜜桃 | 日本欧美一区二区在线观看| 91网上在线视频| 国产精品电影一区二区| 成人国产精品免费观看动漫| 精品国产乱码久久久久久牛牛| 日韩国产一区二| 欧美一区二区视频免费观看| 亚洲人成在线播放网站岛国| 国产成人午夜片在线观看高清观看| 精品久久国产老人久久综合| 免费一区二区视频| 欧美一三区三区四区免费在线看| 亚洲影院理伦片| 91色porny在线视频| 一区二区三区欧美激情| 欧洲人成人精品| 爽好多水快深点欧美视频| 91.com视频| 国产一区二区三区黄视频|