- Timestamp:
- 08/15/17 21:01:03 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPareConfigurationBuilder/src/de/ugoe/cs/crosspare/ConfigurationBuilder.java
r144 r145 52 52 private static final String storageFolder = "config/"; 53 53 54 private static final String HPCConfigFolder = "../cpdp-experiments/HPC/benchmark/"; 55 54 56 public static void main(String[] args) { 55 57 for( Dataset dataset : Dataset.values() ) { … … 84 86 writeFile("Ryu15", dataset); 85 87 writeFile("Nam15", dataset); 88 writeFile("Tantithamthavorn16", dataset); 89 writeFile("Hosseini16", dataset); 90 writeFile("FZhang16", dataset); 86 91 } 87 92 } … … 106 111 catch (IOException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { 107 112 e.printStackTrace(); 113 } 114 115 if( approach.equals("Nam13") && (dataset.toString().startsWith("JUR") || dataset.toString().startsWith("NET") || dataset.toString().startsWith("MDP"))) { 116 file = new File(HPCConfigFolder + "config-infeasible/"+ dataset.toString() + "-" + approach + ".xml"); 117 file.getParentFile().mkdirs(); 118 try(FileWriter writer = new FileWriter(file);) { 119 writer.append((String) ConfigurationBuilder.class.getMethod(approach, Dataset.class).invoke(null, dataset)); 120 writer.flush(); 121 } 122 catch (IOException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { 123 e.printStackTrace(); 124 } 125 } 126 else if( dataset==Dataset.AEEEM_LDHHWCHU || dataset==Dataset.JURECZKO || dataset==Dataset.NETGENE || dataset==Dataset.RELINK || dataset==Dataset.MDP ) { 127 file = new File(HPCConfigFolder + "config/"+ dataset.toString() + "-" + approach + ".xml"); 128 file.getParentFile().mkdirs(); 129 try(FileWriter writer = new FileWriter(file);) { 130 writer.append((String) ConfigurationBuilder.class.getMethod(approach, Dataset.class).invoke(null, dataset)); 131 writer.flush(); 132 } 133 catch (IOException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { 134 e.printStackTrace(); 135 } 136 } 137 else if( dataset==Dataset.AEEEM_LDHHWCHU_NUMERIC_DUPLICATE || dataset==Dataset.JURECZKO_NUMERIC_DUPLICATE || dataset==Dataset.NETGENE_NUMERIC_DUPLICATE ) { 138 file = new File(HPCConfigFolder + "config-duplicates/"+ dataset.toString() + "-" + approach + ".xml"); 139 file.getParentFile().mkdirs(); 140 try(FileWriter writer = new FileWriter(file);) { 141 writer.append((String) ConfigurationBuilder.class.getMethod(approach, Dataset.class).invoke(null, dataset)); 142 writer.flush(); 143 } 144 catch (IOException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { 145 e.printStackTrace(); 146 } 147 } 148 else if( dataset==Dataset.AEEEM_LDHHWCHU_NUMERIC || dataset==Dataset.JURECZKO_NUMERIC || dataset==Dataset.NETGENE_NUMERIC ) { 149 file = new File(HPCConfigFolder + "config-numeric/"+ dataset.toString() + "-" + approach + ".xml"); 150 file.getParentFile().mkdirs(); 151 try(FileWriter writer = new FileWriter(file);) { 152 writer.append((String) ConfigurationBuilder.class.getMethod(approach, Dataset.class).invoke(null, dataset)); 153 writer.flush(); 154 } 155 catch (IOException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { 156 e.printStackTrace(); 157 } 158 } 159 else if( dataset==Dataset.AEEEM_LDHHWCHU_NUMERIC_WEIGHTS || dataset==Dataset.JURECZKO_NUMERIC_WEIGHTS || dataset==Dataset.NETGENE_NUMERIC_WEIGHTS ) { 160 file = new File(HPCConfigFolder + "config-weights/"+ dataset.toString() + "-" + approach + ".xml"); 161 file.getParentFile().mkdirs(); 162 try(FileWriter writer = new FileWriter(file);) { 163 writer.append((String) ConfigurationBuilder.class.getMethod(approach, Dataset.class).invoke(null, dataset)); 164 writer.flush(); 165 } 166 catch (IOException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { 167 e.printStackTrace(); 168 } 169 } 170 else if( dataset==Dataset.AEEEM_LDHHWCHU_EFFNORM_NUMERIC || dataset==Dataset.JURECZKO_EFFNORM_NUMERIC || dataset==Dataset.RELINK_EFFNORM || dataset==Dataset.MDP_EFFNORM ) { 171 file = new File(HPCConfigFolder + "config-effnorm/"+ dataset.toString() + "-" + approach + ".xml"); 172 file.getParentFile().mkdirs(); 173 try(FileWriter writer = new FileWriter(file);) { 174 writer.append((String) ConfigurationBuilder.class.getMethod(approach, Dataset.class).invoke(null, dataset)); 175 writer.flush(); 176 } 177 catch (IOException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { 178 e.printStackTrace(); 179 } 108 180 } 109 181 } … … 355 427 356 428 configFile.append(" <eval name=\"CVWekaEvaluation\" param=\"\" />\n"); 429 configFile.append(" <executionStrategy name=\"CrossValidationExperiment\" param=\"\" />\n"); 430 configFile.append(" <repetitions number=\"10\" />\n"); 357 431 358 432 postamble(configFile); … … 523 597 524 598 configFile.append(" <preprocessor name=\"ZScoreNormalization\" param=\"\" />\n"); 525 configFile.append(" <trainer name=\"WekaTraining\" param=\"MODEP de.ugoe.cs.cpdp.wekaclassifier.MODEPClassifier -R 0.7\" />\n"); 599 configFile.append(" <trainer name=\"WekaTraining\" param=\"MODEP100 de.ugoe.cs.cpdp.wekaclassifier.MODEPClassifier -R 1.0\" />\n"); 600 configFile.append(" <trainer name=\"WekaTraining\" param=\"MODEP90 de.ugoe.cs.cpdp.wekaclassifier.MODEPClassifier -R 0.9\" />\n"); 601 configFile.append(" <trainer name=\"WekaTraining\" param=\"MODEP80 de.ugoe.cs.cpdp.wekaclassifier.MODEPClassifier -R 0.8\" />\n"); 602 configFile.append(" <trainer name=\"WekaTraining\" param=\"MODEP70 de.ugoe.cs.cpdp.wekaclassifier.MODEPClassifier -R 0.7\" />\n"); 603 configFile.append(" <trainer name=\"WekaTraining\" param=\"MODEP60 de.ugoe.cs.cpdp.wekaclassifier.MODEPClassifier -R 0.6\" />\n"); 604 configFile.append(" <trainer name=\"WekaTraining\" param=\"MODEP50 de.ugoe.cs.cpdp.wekaclassifier.MODEPClassifier -R 0.5\" />\n"); 605 configFile.append(" <trainer name=\"WekaTraining\" param=\"MODEP40 de.ugoe.cs.cpdp.wekaclassifier.MODEPClassifier -R 0.4\" />\n"); 606 configFile.append(" <trainer name=\"WekaTraining\" param=\"MODEP30 de.ugoe.cs.cpdp.wekaclassifier.MODEPClassifier -R 0.3\" />\n"); 607 configFile.append(" <trainer name=\"WekaTraining\" param=\"MODEP20 de.ugoe.cs.cpdp.wekaclassifier.MODEPClassifier -R 0.2\" />\n"); 608 configFile.append(" <trainer name=\"WekaTraining\" param=\"MODEP10 de.ugoe.cs.cpdp.wekaclassifier.MODEPClassifier -R 0.1\" />\n"); 526 609 configFile.append(" <eval name=\"NormalWekaEvaluation\" param=\"\" />\n"); 527 610 configFile.append(" <repetitions number=\"10\" />\n"); … … 643 726 case AEEEM_LDHHWCHU_EFFNORM_NUMERIC: 644 727 case AEEEM_LDHHWCHU_EFFLOGNORM_NUMERIC: 728 case AEEEM_LDHHWCHU_NUMERIC_DUPLICATE: 729 case AEEEM_LDHHWCHU_NUMERIC_WEIGHTS: 645 730 numNeighbors = 1; 646 731 break; … … 652 737 case JURECZKO: 653 738 case JURECZKO_NUMERIC: 739 case JURECZKO_NUMERIC_DUPLICATE: 740 case JURECZKO_NUMERIC_WEIGHTS: 654 741 case JURECZKO_EFFNORM: 655 742 case JURECZKO_EFFLOGNORM: … … 668 755 case NETGENE: 669 756 case NETGENE_NUMERIC: 757 case NETGENE_NUMERIC_DUPLICATE: 758 case NETGENE_NUMERIC_WEIGHTS: 670 759 numNeighbors = 1; 671 760 break; … … 835 924 return configFile.toString(); 836 925 } 926 927 public static String Tantithamthavorn16(Dataset dataset) { 928 StringBuilder configFile = new StringBuilder(); 929 preamble(configFile); 930 dataset(configFile, dataset); 931 932 configFile.append(" <trainer name=\"WekaTraining\" param=\"NBCARET de.ugoe.cs.cpdp.wekaclassifier.NaiveBayesCaret\" />\n"); 933 configFile.append(" <trainer name=\"WekaTraining\" param=\"RFCARET weka.classifiers.trees.RandomForest -CVPARAM I 10 50 10\" />\n"); 934 configFile.append(" <trainer name=\"WekaTraining\" param=\"SVMCARET de.ugoe.cs.cpdp.wekaclassifier.SMOCaret\" />\n"); 935 //configFile.append(" <trainer name=\"WekaTraining\" param=\"C50CARET de.ugoe.cs.cpdp.wekaclassifier.C50Caret\" />\n"); 936 configFile.append(" <eval name=\"NormalWekaEvaluation\" param=\"\" />\n"); 937 configFile.append(" <repetitions number=\"10\" />\n"); 938 939 postamble(configFile); 940 return configFile.toString(); 941 } 942 943 public static String Hosseini16(Dataset dataset) { 944 StringBuilder configFile = new StringBuilder(); 945 preamble(configFile); 946 dataset(configFile, dataset); 947 948 configFile.append(" <testawaretrainer name=\"WekaTestAwareTraining\" param=\"SBS de.ugoe.cs.cpdp.wekaclassifier.SearchBasedSelectionClassifier\" />\n"); 949 configFile.append(" <eval name=\"NormalWekaEvaluation\" param=\"\" />\n"); 950 configFile.append(" <repetitions number=\"10\" />\n"); 951 952 postamble(configFile); 953 return configFile.toString(); 954 } 955 956 public static String FZhang16(Dataset dataset) { 957 StringBuilder configFile = new StringBuilder(); 958 preamble(configFile); 959 dataset(configFile, dataset); 960 961 configFile.append(" <preprocessor name=\"ZScoreNormalization\" param=\"\" />\n"); 962 configFile.append(" <setwiseselector name=\"TestAsTraining\" param=\"\" />\n"); 963 configFile.append(" <trainer name=\"WekaTraining\" param=\"SC de.ugoe.cs.cpdp.wekaclassifier.SpectralClusteringClassifier\" />\n"); 964 configFile.append(" <eval name=\"NormalWekaEvaluation\" param=\"\" />\n"); 965 966 postamble(configFile); 967 return configFile.toString(); 968 } 837 969 }
Note: See TracChangeset
for help on using the changeset viewer.