Ignore:
Timestamp:
05/13/16 13:16:05 (9 years ago)
Author:
sherbold
Message:
  • improved error reporting
Location:
trunk/CrossPare/src/de/ugoe/cs/cpdp/training
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/training/WekaBaggingTraining.java

    r86 r99  
    1515package de.ugoe.cs.cpdp.training; 
    1616 
    17 import java.io.PrintStream; 
    1817import java.util.HashSet; 
    1918import java.util.LinkedList; 
     
    2221 
    2322import org.apache.commons.collections4.list.SetUniqueList; 
    24 import org.apache.commons.io.output.NullOutputStream; 
    2523 
    2624import weka.classifiers.AbstractClassifier; 
     
    6058    @Override 
    6159    public void apply(SetUniqueList<Instances> traindataSet) { 
    62         PrintStream errStr = System.err; 
    63         System.setErr(new PrintStream(new NullOutputStream())); 
    6460        try { 
    6561            classifier.buildClassifier(traindataSet); 
     
    6763        catch (Exception e) { 
    6864            throw new RuntimeException(e); 
    69         } 
    70         finally { 
    71             System.setErr(errStr); 
    7265        } 
    7366    } 
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/training/WekaLocalEMTraining.java

    r86 r99  
    1515package de.ugoe.cs.cpdp.training; 
    1616 
    17 import java.io.PrintStream; 
    1817import java.util.HashMap; 
    1918import java.util.HashSet; 
     
    2221import java.util.Set; 
    2322import java.util.logging.Level; 
    24  
    25 import org.apache.commons.io.output.NullOutputStream; 
    2623 
    2724import de.ugoe.cs.util.console.Console; 
     
    5956    @Override 
    6057    public void apply(Instances traindata) { 
    61         PrintStream errStr = System.err; 
    62         System.setErr(new PrintStream(new NullOutputStream())); 
    6358        try { 
    6459            classifier.buildClassifier(traindata); 
     
    6661        catch (Exception e) { 
    6762            throw new RuntimeException(e); 
    68         } 
    69         finally { 
    70             System.setErr(errStr); 
    7163        } 
    7264    } 
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/training/WekaLocalFQTraining.java

    r86 r99  
    1515package de.ugoe.cs.cpdp.training; 
    1616 
    17 import java.io.PrintStream; 
    1817import java.util.ArrayList; 
    1918import java.util.HashMap; 
     
    2322import java.util.Set; 
    2423import java.util.logging.Level; 
    25  
    26 import org.apache.commons.io.output.NullOutputStream; 
    2724 
    2825import de.ugoe.cs.cpdp.training.QuadTree; 
     
    6663    @Override 
    6764    public void apply(Instances traindata) { 
    68         PrintStream errStr = System.err; 
    69         System.setErr(new PrintStream(new NullOutputStream())); 
    7065        try { 
    7166            classifier.buildClassifier(traindata); 
     
    7368        catch (Exception e) { 
    7469            throw new RuntimeException(e); 
    75         } 
    76         finally { 
    77             System.setErr(errStr); 
    7870        } 
    7971    } 
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/training/WekaTestAwareTraining.java

    r86 r99  
    1515package de.ugoe.cs.cpdp.training; 
    1616 
    17 import java.io.PrintStream; 
    1817import java.util.logging.Level; 
    19  
    20 import org.apache.commons.io.output.NullOutputStream; 
    2118 
    2219import de.ugoe.cs.cpdp.wekaclassifier.ITestAwareClassifier; 
     
    3532        } 
    3633        ((ITestAwareClassifier) classifier).setTestdata(testdata); 
    37         PrintStream errStr = System.err; 
    38         System.setErr(new PrintStream(new NullOutputStream())); 
    3934        try { 
    4035            if (classifier == null) { 
     
    6055            } 
    6156        } 
    62         finally { 
    63             System.setErr(errStr); 
    64         } 
    6557    } 
    6658} 
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/training/WekaTraining.java

    r86 r99  
    1515package de.ugoe.cs.cpdp.training; 
    1616 
    17 import java.io.PrintStream; 
    1817import java.util.logging.Level; 
    19  
    20 import org.apache.commons.io.output.NullOutputStream; 
    2118 
    2219import de.ugoe.cs.util.console.Console; 
     
    5249            throw new RuntimeException("classifier of WekaTraining is null"); 
    5350        } 
    54         PrintStream errStr = System.err; 
    55         System.setErr(new PrintStream(new NullOutputStream())); 
    5651        try { 
    5752            if (classifier == null) { 
     
    7772            } 
    7873        } 
    79         finally { 
    80             System.setErr(errStr); 
    81         } 
    8274    } 
    8375} 
Note: See TracChangeset for help on using the changeset viewer.