Changeset 91
- Timestamp:
- 05/12/16 10:19:58 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/training/WekaLASERTraining.java
r86 r91 15 15 package de.ugoe.cs.cpdp.training; 16 16 17 import java.io.PrintStream;18 17 import java.util.LinkedList; 19 18 import java.util.List; 20 21 import org.apache.commons.io.output.NullOutputStream;22 19 23 20 import de.ugoe.cs.cpdp.util.WekaUtils; … … 46 43 @Override 47 44 public void apply(Instances traindata) { 48 PrintStream errStr = System.err;49 System.setErr(new PrintStream(new NullOutputStream()));50 45 try { 51 46 internalClassifier.buildClassifier(traindata); … … 53 48 catch (Exception e) { 54 49 throw new RuntimeException(e); 55 }56 finally {57 System.setErr(errStr);58 50 } 59 51 } … … 111 103 for( Integer index : closestToTrainingInstance ) { 112 104 if( Double.isNaN(label) ) { 113 label = traindata.get( closestToTrainingInstance.get(index)).classValue();105 label = traindata.get(index).classValue(); 114 106 } 115 else if( label!=traindata.get( closestToTrainingInstance.get(index)).classValue() ) {107 else if( label!=traindata.get(index).classValue() ) { 116 108 allEqual = false; 117 109 break; … … 130 122 for( Integer index : closestInstances ) { 131 123 if( Double.isNaN(label) ) { 132 label = traindata.get( closestInstances.get(index)).classValue();124 label = traindata.get(index).classValue(); 133 125 } 134 else if( label!=traindata.get( closestInstances.get(index)).classValue() ) {126 else if( label!=traindata.get(index).classValue() ) { 135 127 allEqual = false; 136 128 break;
Note: See TracChangeset
for help on using the changeset viewer.