-
Notifications
You must be signed in to change notification settings - Fork 2
/
GESimulatePredictD50K30C.R
86 lines (51 loc) · 1.84 KB
/
GESimulatePredictD50K30C.R
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
### This simulation Checks if the model can predict well with 10 Dimensions
### Also CHECK THE TIME REQUIRED FOR THE MODEL
### Remove The Past
rm(list = ls())
#################################### SIMULATED DATA PROPERTIES ####################################################
## Number of points
N.test = 100
N.train =100
## Number of Clusters
F = 3
## Distribution of the points within three clusters
p.dist = c(0.4,0.3,0.3)
## Total Number of features D
D = 50
## Total Percentage of irrelevant feature
prob.noise.feature = 0.6
## Overlap between Cluster of molecular Data of the relevant features
prob.overlap = 0.01
###### Get the Data #####################################
## Initialize the Training Data
source('simulateDPMM.R')
simulateDPMM()
############################# PARAMETERS for GIBB's SAMPLING ####
iter = 100
iter.burnin = 5*D
iter.thin =5
k =3
########################### Initialize the functions ############
######################### Initialize the Parameters ################
source('initializeDPMM.R')
initializeDPMM()
######### Ground Truth ##############################
source('SIMgroundtruth.R')
#SIMgroundtruth()
########### Train the Model #########################################
source('burninDPMM.R')
burninDPMM()
source('gibbsDPMM.R')
gibbsDPMM()
########## Analyze the fit ##########################################
source('SIManalyzeDPMM.R')
SIManalyzeDPMM()
######## Predict on New Data Set #####################################
source('predictCLASS.R')
predictCLASS(Y.new, time.new)
## Check how much concordance is there
test.randindex <- adjustedRandIndex(apply(posteriorprob,1,which.max),c.true.new)
source('predictchineseAFTtime.R')
predictchineseAFTtime(Y.new)
### Check of the Predicted C-index ## 91% concordance
predicted.cindex <- survConcordance(Surv(time.new,censoring.new) ~ exp(-post.time.avg))[1]