Changeset 135 for trunk/CrossPare/src/de/ugoe/cs/cpdp/wekaclassifier
- Timestamp:
- 07/18/16 12:26:03 (8 years ago)
- Location:
- trunk/CrossPare/src/de/ugoe/cs/cpdp/wekaclassifier
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/wekaclassifier/BayesNetWrapper.java
r130 r135 40 40 * generated ID 41 41 */ 42 /** */43 42 private static final long serialVersionUID = -4835134612921456157L; 44 43 -
trunk/CrossPare/src/de/ugoe/cs/cpdp/wekaclassifier/FixClass.java
r86 r135 23 23 24 24 /** 25 * Simple classifier that always predicts the same class 25 * Simple classifier that always predicts the same class. 26 26 * 27 27 * @author Steffen Herbold … … 29 29 public class FixClass extends AbstractClassifier { 30 30 31 /** 32 * default serialization ID 33 */ 31 34 private static final long serialVersionUID = 1L; 32 35 36 /** 37 * default prediction: non-defective 38 */ 33 39 private double fixedClassValue = 0.0d; 34 35 public FixClass() {36 // TODO Auto-generated constructor stub37 }38 40 39 41 /** … … 66 68 } 67 69 70 /* 71 * (non-Javadoc) 72 * 73 * @see weka.classifiers.AbstractClassifier#setOptions(java.lang.String[]) 74 */ 68 75 @Override 69 76 public void setOptions(String[] options) throws Exception { … … 71 78 } 72 79 80 /* 81 * (non-Javadoc) 82 * 83 * @see weka.classifiers.AbstractClassifier#classifyInstance(weka.core.Instance) 84 */ 73 85 @Override 74 86 public double classifyInstance(Instance instance) { … … 76 88 } 77 89 90 /* 91 * (non-Javadoc) 92 * 93 * @see weka.classifiers.Classifier#buildClassifier(weka.core.Instances) 94 */ 78 95 @Override 79 96 public void buildClassifier(Instances traindata) throws Exception { -
trunk/CrossPare/src/de/ugoe/cs/cpdp/wekaclassifier/ITestAwareClassifier.java
r66 r135 1 1 2 package de.ugoe.cs.cpdp.wekaclassifier; 2 3 3 4 import weka.core.Instances; 4 5 6 /** 7 * <p> 8 * Interface for test data aware classifier implementations 9 * </p> 10 * 11 * @author Steffen Herbold 12 */ 5 13 public interface ITestAwareClassifier { 6 14 15 /** 16 * <p> 17 * passes the test data to the classifier 18 * </p> 19 * 20 * @param testdata 21 * the test data 22 */ 7 23 public void setTestdata(Instances testdata); 8 24 -
trunk/CrossPare/src/de/ugoe/cs/cpdp/wekaclassifier/RandomClass.java
r86 r135 22 22 23 23 /** 24 * <p> 24 25 * Assigns a random class label to the instance it is evaluated on. 25 * 26 * </p> 26 27 * The range of class labels are hardcoded in fixedClassValues. This can later be extended to take 27 28 * values from the XML configuration. 29 * </p> 30 * 31 * @author Alexander Trautsch 28 32 */ 29 33 public class RandomClass extends AbstractClassifier { 30 34 35 /** 36 * default serialization id 37 */ 31 38 private static final long serialVersionUID = 1L; 32 39 40 /** 41 * class values 42 */ 33 43 private double[] fixedClassValues = 34 44 { 0.0d, 1.0d }; 35 45 46 /* 47 * (non-Javadoc) 48 * 49 * @see weka.classifiers.Classifier#buildClassifier(weka.core.Instances) 50 */ 36 51 @Override 37 52 public void buildClassifier(Instances arg0) throws Exception { … … 39 54 } 40 55 56 /* 57 * (non-Javadoc) 58 * 59 * @see weka.classifiers.AbstractClassifier#classifyInstance(weka.core.Instance) 60 */ 41 61 @Override 42 62 public double classifyInstance(Instance instance) { -
trunk/CrossPare/src/de/ugoe/cs/cpdp/wekaclassifier/VCBSVM.java
r105 r135 334 334 */ 335 335 private Instances weightedResample(final Instances data, final int size) { 336 if ( data.isEmpty()) {336 if (data.isEmpty()) { 337 337 return data; 338 338 } -
trunk/CrossPare/src/de/ugoe/cs/cpdp/wekaclassifier/WHICH.java
r127 r135 268 268 score = 0; 269 269 } 270 if ( score==0) {270 if (score == 0) { 271 271 score = 0.000000001; // to disallow 0 total score 272 272 } … … 296 296 else { 297 297 String range = ranges.get(k); 298 if ( "'All'".equals(range)) {298 if ("'All'".equals(range)) { 299 299 result = true; 300 } else { 300 } 301 else { 301 302 double instanceValue = instance.value(attrIndex); 302 303 double lowerBound; … … 327 328 else { 328 329 // first value is positive 329 if( splitResult[0].substring(2, splitResult[0].length()).equals("ll'")) { 330 if (splitResult[0].substring(2, splitResult[0].length()) 331 .equals("ll'")) 332 { 330 333 System.out.println("foo"); 331 334 } 332 lowerBound = Double 333 . parseDouble(splitResult[0].substring(2, splitResult[0].length()));335 lowerBound = Double.parseDouble(splitResult[0] 336 .substring(2, splitResult[0].length())); 334 337 if (splitResult[1].startsWith("inf")) { 335 338 upperBound = Double.POSITIVE_INFINITY; … … 346 349 boolean upperBoundMatch = (range.charAt(range.length() - 2) == ')' && 347 350 instanceValue < upperBound) || 348 (range.charAt(range.length() - 2) == ']' && instanceValue <= upperBound); 351 (range.charAt(range.length() - 2) == ']' && 352 instanceValue <= upperBound); 349 353 result = lowerBoundMatch && upperBoundMatch; 350 354 }
Note: See TracChangeset
for help on using the changeset viewer.