Predicting Mortality of ICU Patients: The PhysioNet/Computing in Cardiology Challenge 2012 1.0.0

File: <base>/sources/mlipoff_at_gmail.com/entry2/physionet2012.m (1,430 bytes)
function [prob,died]=physionet2012(tm,category,val)
% [prob,SAPS_SCORE,died]=physionet2012(tm,category,val)
% 
% Sample Submission for the PhysioNet 2012 Challenge. Variables our:
% 
% tm      - (Nx1 Cell Array) Cell array containing time of measurement
% category- (Nx1 Cell Array) Cell array containing type (category)
%           measurement
% value   - (Nx1 Cell Array) Cell array containing value of measurement
%
% 
% prob      - (Scalar) Probability value of the patient dying in the hospital.
% died      - (Logical)Binary classification if the patient is going to die
%             on the hospital (1 - Died, 0 - Survived)
% 
% Example:
% [prob,died]=physionet2012(tm,category,val)

%include m-files: MakePatientStruct, TabulatePatientRecordData_binsChangeable, 
%                     svmclassify_ML, svmdecision_ML,
%                     kernelList
%include mat-files: Model_Submission1.mat, scaling.mat



patient.textdata = [['time'; tm], ['category';category]];
patient.data = val;


%take in the data and make it a struct for the one patient
patientStruct = MakePatientStruct(patient);


%make the data into a matrix
spreads = importdata('Spreads.mat');
[X, ~] = TabulatePatientRecordData_binsChangeable2(patientStruct, spreads); 


%---> bring in the model here
model = importdata('Model_Submission2.mat');
model.ScaleData = importdata('scaling.mat');

%get the results
[died, prob] = svmclassify_ML(model, X);

end