forked from WangLabHKUST/METANET-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetanet_model2_organotropic_stratification.m
executable file
·46 lines (36 loc) · 1.21 KB
/
metanet_model2_organotropic_stratification.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
% Predict survival-associated metastatic risk
% ordinal model
clear
clc
close all
addpath /Users/bjiang/Documents/MATLAB/orca/src/Utils
addpath /Users/bjiang/Documents/MATLAB/orca/src/Measures
addpath /Users/bjiang/Documents/MATLAB/orca/src/Algorithms
if (exist ('OCTAVE_VERSION', 'builtin') > 0)
pkg load statistics
try
graphics_toolkit ('gnuplot')
catch
error('This code uses gnuplot for plotting. Please install gnuplot and restart Octave to run this code.')
end
end
% Disable MATLAB warnings
warning('off','MATLAB:nearlySingularMatrix')
warning('off','stats:mnrfit:IterOrEvalLimit')
%% load data
load input.mat
%% Apply POM model
% Create the POM object
algorithmObj = POM();
% Train POM
POMinfo = algorithmObj.fitpredict(train,test);
%% TCGA Validation
model = POMinfo.model;
[vprob,vdlow,vdhi] = mnrval([-model.thresholds'; model.projection],...
scaledXval,model.Stats,'model','ordinal','interactions','off',...
'Link','logit');
[~,vpredlabel] = max(vprob,[],2);
ystar = scaledXval*model.projection;
[p, fh, stats] = svval(vpredlabel,clinic,false);
pairwisepvalue = table(stats.ParwiseName, [stats.ParwiseStats(1).p_MC;stats.ParwiseStats(2).p_MC;stats.ParwiseStats(3).p_MC]);
disp(pairwisepvalue)