[418bf5]: / src / biodiscml / demo.java

Download this file

197 lines (186 with data), 12.4 kB

  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
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/*
*
*/
package biodiscml;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.HashMap;
/**
*
* @author mik
*/
public class demo {
// public static String folder = "/home/mickael/ownCloud/";
public static String folder = "E:\\cloud\\";
// public static String folder = "C:\\Users\\Mickael\\ownCloud\\";
public static void main(String[] args) {
System.out.println("=== Demo mode ===");
//trainingExecution();
//testingExecution();
bestModel();
//benchmark();
}
private static void trainingExecution() {
try {
//String s[] = {"-config " + folder + "Data\\TCGA_PRAD\\datamining\\config.conf -train"};
//String s[] = {"-config " + folder + "Data\\TCGA_PRAD\\datamining\\time\\config.conf -train"};
//String s[] = {"-config " + folder + "Projects/loreal/VESPA/datamining//config_vespa.conf -train"};
//String s[] = {"-config " + folder + "/Projects/Benjamin/Collaboration-CHUL-Quebec/1_Prostate/READY_TO_USE_for_Brute_force_X/datamining/2_Genes+clinic/config.conf -train"};
//String s[] = {"-config config_example_2class.conf -train"};
String s[] = {"-config " + folder + "Code\\BruteForceML\\benchmark\\CNS_test/config.conf -train"};
//String s[] = {"-config " + folder + "Code/BruteForceML/benchmark/Benjamin_signature/config.conf -train"};
//String s[] = {"-config " + folder + "Projects\\bacteria\\datamining\\config.conf -train"};
Main.main(s);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void bestModel() {
Main m = new Main();
//demo Benjamin
// m.wd = folder + "Projects\\Benjamin\\Collaboration - CHUL - Quebec\\1_Prostate\\READY_TO_USE_for_Brute_force_X\\datamining\\";
// m.configFile = m.wd + "config.conf";
// m.setConfiguration();
// m.wd = folder + "Projects\\Benjamin\\Collaboration - CHUL - Quebec\\1_Prostate\\READY_TO_USE_for_Brute_force_X\\datamining\\";
// String CLASSIFICATION_FILE = m.wd + m.project + "a.classification.data_to_train.csv"; // output of Training(), models performances
// String TRAINING_RESULTS_FILE = m.wd + m.project + "c.classification.results.csv"; // output of Training(), models performances
// String FEATURE_SELECTION_FILE = m.wd + m.project + "b.featureSelection.infoGain.csv"; // output of Training(), feature selection result
// BestModelSelectionAndReport b = new BestModelSelectionAndReport(CLASSIFICATION_FILE, FEATURE_SELECTION_FILE, TRAINING_RESULTS_FILE,
// "classification");
// //mint
// m.wd = folder + "Code/BruteForceML/benchmark/mint/";
// m.configFile = m.wd + "config.conf";
// m.setConfiguration();
// m.wd = folder + "Code/BruteForceML/benchmark/mint/";
// m.hmTrainingBestModelList.put("trees.RandomForest_AUC_BF_16_0.9571_77", "1");
// String CLASSIFICATION_FILE = m.wd + m.project + "a.classification.data_to_train.csv"; // output of Training(), models performances
// String TRAINING_RESULTS_FILE = m.wd + m.project + "c.classification.results.csv"; // output of Training(), models performances
// String FEATURE_SELECTION_FILE = m.wd + m.project + "b.featureSelection.infoGain.csv"; // output of Training(), feature selection result
// BestModelSelectionAndReport b = new BestModelSelectionAndReport(CLASSIFICATION_FILE, FEATURE_SELECTION_FILE, TRAINING_RESULTS_FILE,
// "classification");
// //mint
m.wd = folder + "Code/BruteForceML/benchmark/CNS_test/";
m.configFile = m.wd + "config.conf";
m.setConfiguration();
m.wd = folder + "Code/BruteForceML/benchmark/CNS_test/";
String CLASSIFICATION_FILE = m.wd + m.project + "a.regression.data_to_train.csv"; // output of Training(), models performances
String TRAINING_RESULTS_FILE = m.wd + m.project + "c.regression.results.csv"; // output of Training(), models performances
String FEATURE_SELECTION_FILE = m.wd + m.project + "b.featureSelection.RELIEFF.csv"; // output of Training(), feature selection result
BestModelSelectionAndReport b = new BestModelSelectionAndReport(CLASSIFICATION_FILE, FEATURE_SELECTION_FILE, TRAINING_RESULTS_FILE,
"regression");
//bacteria
// m.wd = folder + "Projects\\bacteria\\datamining\\";
// m.configFile = m.wd + "config.conf";
// m.setConfiguration();
// m.wd = folder + "Projects\\bacteria\\datamining\\";
// m.hmTrainingBestModelList.put("trees.RandomForest_AUC_B_25_0.9531_907", "1");
// String CLASSIFICATION_FILE = m.wd + m.project + "a.classification.data_to_train.csv"; // output of Training(), models performances
// String TRAINING_RESULTS_FILE = m.wd + m.project + "c.classification.results.csv"; // output of Training(), models performances
// String FEATURE_SELECTION_FILE = m.wd + m.project + "b.featureSelection.infoGain.csv"; // output of Training(), feature selection result
// BestModelSelectionAndReport b = new BestModelSelectionAndReport(CLASSIFICATION_FILE, FEATURE_SELECTION_FILE, TRAINING_RESULTS_FILE,
// "classification");
// //benjamin
// m.wd = folder + "Code/BruteForceML/benchmark/Benjamin_prostate/";
// m.configFile = m.wd + "config.conf";
// m.setConfiguration();
// m.wd = folder + "Code/BruteForceML/benchmark/Benjamin_prostate/";
// String CLASSIFICATION_FILE = m.wd + m.project + "a.classification.data_to_train.csv"; // output of Training(), models performances
// String TRAINING_RESULTS_FILE = m.wd + m.project + "c.classification.results.csv"; // output of Training(), models performances
// String FEATURE_SELECTION_FILE = m.wd + m.project + "b.featureSelection.infoGain.csv"; // output of Training(), feature selection result
// BestModelSelectionAndReport b = new BestModelSelectionAndReport(CLASSIFICATION_FILE, FEATURE_SELECTION_FILE, TRAINING_RESULTS_FILE,
// "classification");
// //golub
// m.wd = folder + "Code/BruteForceML/benchmark/brain/";
// m.configFile = m.wd + "config.conf";
// m.setConfiguration();
// m.wd = folder + "Code/BruteForceML/benchmark/brain/";
// String CLASSIFICATION_FILE = m.wd + m.project + "a.classification.data_to_train.csv"; // output of Training(), models performances
// String TRAINING_RESULTS_FILE = m.wd + m.project + "c.classification.results.csv"; // output of Training(), models performances
// String FEATURE_SELECTION_FILE = m.wd + m.project + "b.featureSelection.infoGain.csv"; // output of Training(), feature selection result
// BestModelSelectionAndReport b = new BestModelSelectionAndReport(CLASSIFICATION_FILE, FEATURE_SELECTION_FILE, TRAINING_RESULTS_FILE,
// "classification");
// //demo dreamchallenge
// m.wd = folder + "Projects\\dreamchallenge\\proteogenomics\\SUB2_ML\\";
// m.configFile = m.wd + "config.conf";
// m.setConfiguration();
// m.wd = folder + "Projects\\dreamchallenge\\proteogenomics\\SUB2_ML\\";
// String CLASSIFICATION_FILE = m.wd + m.project + "a.regression.data_to_train.csv"; // output of Training(), models performances
// String TRAINING_RESULTS_FILE = m.wd + m.project + "c.regression.results.csv"; // output of Training(), models performances
// String FEATURE_SELECTION_FILE = m.wd + m.project + "b.featureSelection.RELIEFF.csv"; // output of Training(), feature selection result
// BestModelSelectionAndReport b = new BestModelSelectionAndReport(CLASSIFICATION_FILE, FEATURE_SELECTION_FILE, TRAINING_RESULTS_FILE,
// "regression");
//demo vespa
// m.wd = folder + "Projects\\loreal\\VESPA\\datamining\\";
// m.configFile = m.wd + "config_vespa.conf";
// m.setConfiguration();
// m.wd = folder + "Projects\\loreal\\VESPA\\datamining\\";
// String CLASSIFICATION_FILE = m.wd + m.project + "a.classification.data_to_train.csv"; // output of Training(), models performances
// String TRAINING_RESULTS_FILE = m.wd + m.project + "c.classification.results.csv"; // output of Training(), models performances
// String FEATURE_SELECTION_FILE = m.wd + m.project + "b.featureSelection.infoGain.csv"; // output of Training(), feature selection result
// BestModelSelectionAndReport b = new BestModelSelectionAndReport(CLASSIFICATION_FILE, FEATURE_SELECTION_FILE, TRAINING_RESULTS_FILE,
// "classification");
//demo DATA
// m.configFile = "config_example_2class.conf";
// m.setConfiguration();
// m.wd = "";
// String CLASSIFICATION_FILE = m.wd + m.project + "a.classification.data_to_train.csv"; // output of Training(), models performances
// String TRAINING_RESULTS_FILE = m.wd + m.project + "c.classification.results.csv"; // output of Training(), models performances
// String FEATURE_SELECTION_FILE = m.wd + m.project + "b.featureSelection.infoGain.csv"; // output of Training(), feature selection result
// BestModelSelectionAndReport b = new BestModelSelectionAndReport(CLASSIFICATION_FILE, FEATURE_SELECTION_FILE, TRAINING_RESULTS_FILE,
// "classification");
}
public static void testingExecution() {
try {
// String s[] = {"-test -model gdx_data_.misc.VFI_-B0.6.txt.model "
// + "-testfiles gdx.545patients.clinical.csv gdx.1742patients.expr.csv "
// //+ "-prefixes clin expr "
// + "-mergingID patient -separator \\t -classification -keyword BCR_sensor"};
String s[] = {"-test -model " + folder + "Data\\TCGA_PRAD\\datamining\\TCGA_BCR_.misc.VFI_-B0.6.txt.model "
+ "-testfiles " + folder + "Data\\TCGA_PRAD\\datamining\\geneExpression.log2RUVg.csv"
+ " " + folder + "Data\\TCGA_PRAD\\datamining\\clinical_test.csv "
+ "-mergingID Patient -separator \\t -classification -keyword BCR_sensor"};
for (String s1 : s) {
System.out.print(s1);
}
System.out.println("");
Main.main(s);
} catch (Exception e) {
e.printStackTrace();
}
}
private static void benchmark() {
try {
PrintWriter pw = new PrintWriter(new FileWriter("benchmark_3.txt"));
pw.println("FeaturesLimit\tAUC_Train\tAUC_Test");
for (int i = 5; i <= 200; i = i + 5) {
//train
Main.hmTrainFiles = new HashMap<>();
Main.needConfigFile = true;
Main.testing = false;
Main.training = true;
System.out.println("\n-------------\nTRAIN " + i);
String s[] = {"-config " + folder + "Data\\TCGA_PRAD\\datamining\\config_opt.conf -train"};
Main.maxNumberOfFeaturesInModel = i;
Main.main(s);
String train = Main.bench_AUC;
//test
Main.hmTrainFiles = new HashMap<>();
Main.configFile = "";
Main.needConfigFile = false;
Main.testing = true;
Main.training = false;
Main.project = "outfile";
System.out.println("\n-------------\nTEST " + i);
String s2[] = {"-test -model " + folder + "Data\\TCGA_PRAD\\datamining\\bench_.misc.VFI_-B0.6.txt.model "
+ "-testfiles " + folder + "Data\\TCGA_PRAD\\datamining\\geneExpression.log2RUVg.csv"
+ " " + folder + "Data\\TCGA_PRAD\\datamining\\clinical_test.csv "
+ "-mergingID Patient -separator \\t -classification -keyword BCR_sensor"};
Main.main(s2);
String test = Main.bench_AUC;
pw.println(i + "\t" + train + "\t" + test);
pw.flush();
}
} catch (Exception e) {
}
}
}