Changeset 45 for trunk/CrossPare/src/de/ugoe/cs
- Timestamp:
- 11/18/15 16:42:40 (9 years ago)
- Location:
- trunk/CrossPare/src/de/ugoe/cs/cpdp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/ExperimentConfiguration.java
r44 r45 489 489 .newInstance(); 490 490 trainer.setParameter(attributes.getValue("param")); 491 trainer.setMethod(attributes.getValue("method")); 492 trainer.setThreshold(attributes.getValue("threshold")); 491 493 setwiseTestdataAwareTrainers.add(trainer); 492 494 } -
trunk/CrossPare/src/de/ugoe/cs/cpdp/training/ISetWiseTestdataAwareTrainingStrategy.java
r44 r45 9 9 10 10 String getName(); 11 12 void setMethod(String method); 13 void setThreshold(String threshold); 11 14 } -
trunk/CrossPare/src/de/ugoe/cs/cpdp/training/MetricMatchingTraining.java
r44 r45 23 23 24 24 import org.apache.commons.collections4.list.SetUniqueList; 25 import org.apache.commons.math3.stat.inference.ChiSquareTest; 26 import org.apache.commons.math3.stat.correlation.SpearmansCorrelation; // spearman ist drin27 import org.apache.commons.math3.stat.inference.KolmogorovSmirnovTest; // kolmogorov nicht in der 3.125 import org.apache.commons.math3.stat.inference.ChiSquareTest; 26 import org.apache.commons.math3.stat.correlation.SpearmansCorrelation; 27 import org.apache.commons.math3.stat.inference.KolmogorovSmirnovTest; 28 28 29 29 import de.ugoe.cs.util.console.Console; … … 42 42 private final Classifier classifier = new MetricMatchingClassifier(); 43 43 44 private String method; 45 private float threshold; 44 46 45 47 /** … … 52 54 } 53 55 54 /*56 55 57 @Override 56 58 public String getName() { 57 return "MetricMatching_" + this.classifier.getName(); 58 }*/ 59 return "MetricMatching_" + classifierName; 60 } 61 62 63 @Override 64 public void setMethod(String method) { 65 this.method = method; 66 } 67 68 69 @Override 70 public void setThreshold(String threshold) { 71 this.threshold = Float.parseFloat(threshold); 72 } 59 73 60 74 /** 61 * We need the testdata instances to do a metric matching so in this special case we get this data75 * We need the testdata instances to do a metric matching, so in this special case we get this data 62 76 * before evaluation 63 77 */ … … 76 90 //tmp.kolmogorovSmirnovTest(0.05); 77 91 78 tmp.spearmansRankCorrelation(0.5); 79 80 //Console.traceln(Level.INFO, "Tested traindata set " + num + " for matching attributes, found " + tmp.getRank() + " matches"); 92 if( this.method.equals("spearman") ) { 93 tmp.spearmansRankCorrelation(this.threshold); 94 } 95 else if( this.method.equals("kolmogorov") ) { 96 tmp.kolmogorovSmirnovTest(this.threshold); 97 } 98 else { 99 throw new RuntimeException("unknown method"); 100 } 81 101 82 102 // we only select the training data from our set with the most matching attributes … … 129 149 this.classifier.buildClassifier(traindata); 130 150 } 131 151 132 152 public void setMetricMatching(MetricMatch mm) { 133 153 this.mm = mm; … … 400 420 } 401 421 } 402 403 404 422 }
Note: See TracChangeset
for help on using the changeset viewer.