📄 testnaif.m.svn-base
字号:
% % BD0 = app(:,1:Napp);% % [N, m]=size(BD0);% % rand('state',0); randn('state',0);% % vide = rand(size(BD0))<(1-DM);% % data=BD0.*vide;% % data = mat_to_bnt(data,0);% % % % %node_type={'tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular'};% % nbloopmax = 6;% % root = 15;% % prior = 0;% % discrete = 1:N;% % profile on% % tic% % [BT_A1, Sbest8,L] = learn_struct_mwst_EM(data, discrete, node_sizes, prior, root, nbloopmax);% % toc% % profile off% % profile report mwstem_austr_1% % BT_A1.dag% % % % %BICT = get_BIC(BT_A1, data)% % BICT2 = get_BICL(BT_A1, L(end) ,m)% % % % bnet_vide = mk_bnet(zeros(N),node_sizes);% % for i=1:N, bnet_vide.CPD{i} = tabular_CPD(bnet_vide, i); end% % profile on% % tic% % [BS_A1, orderSEM8, BIC_scoreSEM8,L] = learn_struct_EM(bnet_vide, data, nbloopmax*4);% % toc% % profile off% % profile report sem_austr_1% % BS_A1.dag% % % % %BICS = get_BIC(BS_A1, data)% % BICS2 = get_BICL(BS_A1, L(end) ,m)% % % % profile on% % tic% % [BTS_A1, orderMWSTSEM8, BIC_scoreMWSTSEM8,L] = learn_struct_EM(BT_A1, data, nbloopmax*3);% % toc% % profile off% % profile report sem_plus_t_austr_1% % BTS_A1.dag% % % % %BICTS = get_BIC(BTS_A1, data)% % BICTS2 = get_BICL(BTS_A1, L(end) ,m)% % save austr_1% % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % clear all;% % close all;% % disp('Australian 2');% % load austr% % class_node=15;% % rand('state',0);randn('state',0);% % melange=1:size(austr,2);% % app=austr(:,melange); clear austr% % Napp=500; %Napp=round(size(app,2)*0.7);% % %Ntest=size(app,2)-Napp;% % %test=app(:,Napp+1:size(app,2));% % node_sizes = max(app')% % % % DM = 0.2% % BD0 = app(:,1:Napp);% % [N, m]=size(BD0);% % rand('state',0); randn('state',0);% % vide = rand(size(BD0))<(1-DM);% % data=BD0.*vide;% % data = mat_to_bnt(data,0);% % % % %node_type={'tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular'};% % nbloopmax = 6;% % root = 15;% % prior = 0;% % discrete = 1:N;% % profile on% % tic% % [BT_A2, Sbest8,L] = learn_struct_mwst_EM(data, discrete, node_sizes, prior, root, nbloopmax);% % toc% % profile off% % profile report mwstem_austr_2% % BT_A2.dag% % % % %BICT = get_BIC(BT_A2, data)% % BICT2 = get_BICL(BT_A2, L(end) ,m)% % % % bnet_vide = mk_bnet(zeros(N),node_sizes);% % for i=1:N, bnet_vide.CPD{i} = tabular_CPD(bnet_vide, i); end% % profile on% % tic% % [BS_A2, orderSEM8, BIC_scoreSEM8,L] = learn_struct_EM(bnet_vide, data, nbloopmax*4);% % toc% % profile off% % profile report sem_austr_2% % BS_A2.dag% % % % %BICS = get_BIC(BS_A2, data)% % BICS2 = get_BICL(BS_A2, L(end) ,m)% % % % profile on% % tic% % [BTS_A2, orderMWSTSEM8, BIC_scoreMWSTSEM8,L] = learn_struct_EM(BT_A2, data, nbloopmax*3);% % toc% % profile off% % profile report sem_plus_t_austr_2% % BTS_A2.dag% % % % %BICTS = get_BIC(BTS_A2, data)% % BICTS2 = get_BICL(BTS_A2, L(end) ,m)% % save austr_2% % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % clear all;% % close all;% % disp('Australian 3');% % load austr% % class_node=15;% % rand('state',0);randn('state',0);% % melange=1:size(austr,2);% % app=austr(:,melange); clear austr% % Napp=500; %Napp=round(size(app,2)*0.7);% % %Ntest=size(app,2)-Napp;% % %test=app(:,Napp+1:size(app,2));% % node_sizes = max(app')% % % % DM = 0.3% % BD0 = app(:,1:Napp);% % [N, m]=size(BD0);% % rand('state',0); randn('state',0);% % vide = rand(size(BD0))<(1-DM);% % data=BD0.*vide;% % data = mat_to_bnt(data,0);% % % % %node_type={'tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular','tabular'};% % nbloopmax = 6;% % root = 15;% % prior = 0;% % discrete = 1:N;% % profile on% % tic% % [BT_A3, Sbest8,L] = learn_struct_mwst_EM(data, discrete, node_sizes, prior, root, nbloopmax);% % toc% % profile off% % profile report mwstem_austr_3% % BT_A3.dag% % % % %BICT = get_BIC(BT_A3, data)% % BICT2 = get_BICL(BT_A3, L(end) ,m)% % % % bnet_vide = mk_bnet(zeros(N),node_sizes);% % for i=1:N, bnet_vide.CPD{i} = tabular_CPD(bnet_vide, i); end% % profile on% % tic% % [BS_A3, orderSEM8, BIC_scoreSEM8,L] = learn_struct_EM(bnet_vide, data, nbloopmax*4);% % toc% % profile off% % profile report sem_austr_3% % BS_A3.dag% % % % %BICS = get_BIC(BS_A3, data)% % BICS2 = get_BICL(BS_A3, L(end) ,m)% % % % profile on% % tic% % [BTS_A3, orderMWSTSEM8, BIC_scoreMWSTSEM8,L] = learn_struct_EM(BT_A3, data, nbloopmax*3);% % toc% % profile off% % profile report sem_plus_t_austr_3% % BTS_A3.dag% % % % %BICTS = get_BIC(BTS_A3, data)% % BICTS2 = get_BICL(BTS_A3, L(end) ,m)% % save austr_3% % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % clear all;% % close all;% % disp('Asia 1')% % load asia2000;% % DM = 0.1% % BD0 = asiab;% % node_sizes = max(BD0');% % [N, m]=size(BD0);% % rand('state',0); randn('state',0);% % vide = rand(size(BD0))<(1-DM);% % data=BD0.*vide;% % data = mat_to_bnt(data,0);% % % % nbloopmax = 8;% % root = 2;% % prior = 0;% % discrete = 1:N;% % thresh = 1e-3;% % profile on% % tic% % [BT_D1, Sbest1,L] = learn_struct_mwst_EM(data, discrete, node_sizes, prior, root, nbloopmax, thresh);% % toc% % profile off% % profile report mwstem_asia_1% % BT_D1.dag% % % % BICT = get_BIC(BT_D1, data)% % BICT2 = get_BICL(BT_D1, L(end) ,m)% % % % bnet_vide = mk_bnet(zeros(N),node_sizes);% % for i=1:N, bnet_vide.CPD{i} = tabular_CPD(bnet_vide, i); end% % profile on% % tic% % [BS_D1, orderSEM1, BIC_scoreSEM1,L] = learn_struct_EM(bnet_vide, data, nbloopmax*3);% % toc% % profile off% % profile report sem_asia_1% % BS_D1.dag% % % % BICS = get_BIC(BS_D1, data)% % BICS2 = get_BICL(BS_D1, L(end) ,m)% % % % profile on% % tic% % [BTS_D1, orderMWSTSEM1, BIC_scoreMWSTSEM1,L] = learn_struct_EM(BT_D1, data, nbloopmax*2);% % toc% % profile off% % profile report sem_plus_t_asia_1% % BTS_D1.dag% % % % BICTS = get_BIC(BTS_D1, data)% % BICTS2 = get_BICL(BTS_D1, L(end) ,m)% % save asia1% % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % clear all;% % close all;% % disp('Asia 2')% % load asia2000;% % DM = 0.2% % BD0 = asiab;% % node_sizes = max(BD0');% % [N, m]=size(BD0);% % rand('state',0); randn('state',0);% % vide = rand(size(BD0))<(1-DM);% % data=BD0.*vide;% % data = mat_to_bnt(data,0);% % % % nbloopmax = 8;% % root = 2;% % prior = 0;% % discrete = 1:N;% % thresh = 1e-3;% % profile on% % tic% % [BT_D2, Sbest1,L] = learn_struct_mwst_EM(data, discrete, node_sizes, prior, root, nbloopmax, thresh);% % toc% % profile off% % profile report mwstem_asia_2% % BT_D2.dag% % % % BICT = get_BIC(BT_D2, data)% % BICT2 = get_BICL(BT_D2, L(end) ,m)% % % % bnet_vide = mk_bnet(zeros(N),node_sizes);% % for i=1:N, bnet_vide.CPD{i} = tabular_CPD(bnet_vide, i); end% % profile on% % tic% % [BS_D2, orderSEM1, BIC_scoreSEM1,L] = learn_struct_EM(bnet_vide, data, nbloopmax*4);% % toc% % profile off% % profile report sem_asia_2% % BS_D2.dag% % % % BICS = get_BIC(BS_D2, data)% % BICS2 = get_BICL(BS_D2, L(end) ,m)% % % % profile on% % tic% % [BTS_D2, orderMWSTSEM1, BIC_scoreMWSTSEM1,L] = learn_struct_EM(BT_D2, data, nbloopmax*3);% % toc% % profile off% % profile report sem_plus_t_asia_2% % BTS_D2.dag% % % % BICTS = get_BIC(BTS_D2, data)% % BICTS2 = get_BICL(BTS_D2, L(end) ,m)% % save asia2% % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % clear all;% % close all;% % disp('Asia 3')% % load asia2000;% % DM = 0.3% % BD0 = asiab;% % node_sizes = max(BD0');% % [N, m]=size(BD0);% % rand('state',0); randn('state',0);% % vide = rand(size(BD0))<(1-DM);% % data=BD0.*vide;% % data = mat_to_bnt(data,0);% % % % nbloopmax = 8;% % root = 2;% % prior = 0;% % discrete = 1:N;% % thresh = 1e-3;% % profile on% % tic% % [BT_D3, Sbest1,L] = learn_struct_mwst_EM(data, discrete, node_sizes, prior, root, nbloopmax, thresh);% % toc% % profile off% % profile report mwstem_asia_3% % BT_D3.dag% % % % BICT = get_BIC(BT_D3, data)% % BICT2 = get_BICL(BT_D3, L(end) ,m)% % % % bnet_vide = mk_bnet(zeros(N),node_sizes);% % for i=1:N, bnet_vide.CPD{i} = tabular_CPD(bnet_vide, i); end% % profile on% % tic% % [BS_D3, orderSEM1, BIC_scoreSEM1,L] = learn_struct_EM(bnet_vide, data, nbloopmax*4);% % toc% % profile off% % profile report sem_asia_3% % BS_D3.dag% % % % BICS = get_BIC(BS_D3, data)% % BICS2 = get_BICL(BS_D3, L(end) ,m)% % % % profile on% % tic% % [BTS_D3, orderMWSTSEM1, BIC_scoreMWSTSEM1,L] = learn_struct_EM(BT_D3, data, nbloopmax*3);% % toc% % profile off% % profile report sem_plus_t_asia_3% % BTS_D3.dag% % % % BICTS = get_BIC(BTS_D3, data)% % BICTS2 = get_BICL(BTS_D3, L(end) ,m)% % save asia3% % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % clear all;% % close all;% % load thyroid_app.mat% % disp('Thyroid');% % data = mat_to_bnt(thyroid_app,-9999);% % [N, m]=size(data);% % prior = 0;% % thresh = 1e-3;% % discrete = 1:N;% % node_sizes = max(thyroid_app');% % % % root = 1;% % nbloopmax = 12;% % profile on% % tic% % [BT_T, Sbest2,L] = learn_struct_mwst_EM(data, discrete, node_sizes, prior, root, nbloopmax, thresh);% % toc% % profile off% % profile report mwstem_thyr% % BT_T.dag% % % % %BICT = get_BIC(BT_T, data)% % BICT2 = get_BICL(BT_T, L(end) ,m)% % % % bnet_vide = mk_bnet(zeros(N),node_sizes);% % for i=1:N, bnet_vide.CPD{i} = tabular_CPD(bnet_vide, i); end% % profile on% % tic% % [BS_T, orderSEM2, BIC_scoreSEM2,L] = learn_struct_EM(bnet_vide, data, nbloopmax*5);% % toc% % profile off% % profile report sem_thyr% % BS_T.dag% % % % %BICS = get_BIC(BS_T, data)% % BICS2 = get_BICL(BS_T, L(end) ,m)% % % % profile on% % tic% % [BTS_T, orderMWSTSEM2, BIC_scoreMWSTSEM2,L] = learn_struct_EM(BT_T, data, nbloopmax*4);% % toc% % profile off% % profile report sem_plus_t_thyr% % BTS_T.dag% % % % %BICTS = get_BIC(BTS_T, data)% % BICTS2 = get_BICL(BTS_T, L(end) ,m)% % save Thyr11% % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % clear all;% % close all;% % load heart2% % disp('heart');% % data = BDMapp;% % data{5,59}=[];% % prior=0;% % root=14;% % nbloopmax = 12;% % thresh = 1e-3;% % m=NbApp;% % % % profile on% % tic% % [BT_H, Sbest3,L] = learn_struct_mwst_EM(data, discrete, node_sizes, prior, root, nbloopmax, thresh);% % toc% % profile off% % profile report mwstem_heart% % BT_H.dag% % % % %BICT = get_BIC(BT_H, data)% % BICT2 = get_BICL(BT_H, L(end) ,m)% % % % bnet_vide = mk_bnet(zeros(N),node_sizes);% % for i=1:N, bnet_vide.CPD{i} = tabular_CPD(bnet_vide, i); end% % profile on% % tic% % [BS_H, orderSEM3, BIC_scoreSEM3,L] = learn_struct_EM(bnet_vide, data, nbloopmax*4);% % toc% % profile off% % profile report sem_heart% % BS_H.dag% % % % %BICS = get_BIC(BS_H, data)% % BICS2 = get_BICL(BS_H, L(end) ,m)% % % % profile on% % tic% % [BTS_H, orderMWSTSEM3, BIC_scoreMWSTSEM3,L] = learn_struct_EM(BT_H, data, nbloopmax*3);% % toc% % profile off% % profile report sem_plus_t_heart% % BTS_H.dag% % % % %BICTS = get_BIC(BTS_H, data)% % BICTS2 = get_BICL(BTS_H, L(end) ,m)% % save heart11% % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%diary off
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -