Predicting Mortality of ICU Patients: The PhysioNet/Computing in Cardiology Challenge 2012 1.0.0
(3,201 bytes)
function plot_means(MEAN_DATA_ALL,DATA,IHD,ALL_CATEGORIES)
num_params=size(MEAN_DATA_ALL,2);
for param_idx=1:num_params
mean_all=MEAN_DATA_ALL(:,param_idx);
mean_1=MEAN_DATA_ALL(IHD==1,param_idx);
mean_0=MEAN_DATA_ALL(IHD==0,param_idx);
isnan1=sum(~isnan(MEAN_DATA_ALL(IHD==1,param_idx)))/(sum(IHD==1));
isnan0=sum(~isnan(MEAN_DATA_ALL(IHD==0,param_idx)))/(sum(IHD==0));
M1 = mode(mean_1);
M0 = mode(mean_0);
% figure(param_idx)
%
% subplot(1,3,1)
% hist(mean_all)
% title([ALL_CATEGORIES{param_idx} ' all'])
%
%
% subplot(1,3,2)
% hist(mean_1)
% title([ALL_CATEGORIES{param_idx} ' 1'])
%
%
% subplot(1,3,3)
% hist(mean_0)
% title([ALL_CATEGORIES{param_idx} ' 0'])
% figure(param_idx+num_params+5)
% hist(mean_1,20)
% h = findobj(gca,'Type','patch');
% set(h,'FaceColor','r','EdgeColor','w','facealpha',0.75)
% hold on;
% hist(mean_0,20)
% h1 = findobj(gca,'Type','patch');
% set(h1,'facealpha',0.75);
% title([ALL_CATEGORIES{param_idx} ' mode0=' num2str(M0) '. ' ' mode1=' num2str(M1)]);
%
%
figure(param_idx+num_params+5)
title([ALL_CATEGORIES{param_idx} ' mode0=' num2str(M0) '. ' ' mode1= ' num2str(M1) '. isnan0= ' num2str(isnan0) '. isnan1= ' num2str(isnan1)]);
subplot(1,2,1)
[N, X] = hist(mean_1,25);
bar(X, N./sum(N), 1);
h = findobj(gca,'Type','patch');
set(h,'FaceColor','r','EdgeColor','w','facealpha',0.75)
hold on;
[N, X] = hist(mean_0, X);
bar(X, N./sum(N), 1);
h1 = findobj(gca,'Type','patch');
set(h1,'facealpha',0.75);
title([ALL_CATEGORIES{param_idx} ' mode0=' num2str(M0) '. ' ' mode1= ' num2str(M1) '. isnan0= ' num2str(isnan0) '. isnan1= ' num2str(isnan1)]);
subplot(1,2,2)
scatter(mean_1,ones(size(mean_1)),'xr')
mean1=mean(mean_1(~isnan(mean_1)));
% vari=var(mean_1(~isnan(mean_1)));
medi=median(mean_1(~isnan(mean_1)));
line([mean1 mean1],[1 0.5],'Color','r')
line([medi medi],[1 0.5],'Color','r','LineStyle','--')
hold on
scatter(mean_0,zeros(size(mean_0)),'ob')
mean0=mean(mean_0(~isnan(mean_0)));
%vari=var(mean_0(~isnan(mean_0)));
medi=median(mean_0(~isnan(mean_0)));
line([mean0 mean0],[0 0.5],'Color','b')
line([medi medi],[0 0.5],'Color','r','LineStyle','--')
title([ALL_CATEGORIES{param_idx} ' mode0=' num2str(M0) '. ' ' mode1= ' num2str(M1) '. isnan0= ' num2str(isnan0) '. isnan1= ' num2str(isnan1)]);
% data = rand(1, 100);
% [N, X] = hist(data, 0:0.1:1);
%
% subplot(2, 1, 1);
% hist(data, 0:0.1:1);
%
% subplot(2, 1, 2);
% bar(X, N./sum(N), 1);
end
end