Changeset 2213

Show
Ignore:
Timestamp:
06/24/08 09:53:55 (4 years ago)
Author:
leo
Message:
 
Location:
sandbox/trunk/AdaBoost/src/org/xerial
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • sandbox/trunk/AdaBoost/src/org/xerial/mining/adaboost/AdaBoost.java

    r2210 r2213  
    168168        List<Classifier> classifierList = prepareWeakClassifier(trainingDataFile); 
    169169 
    170         _logger.trace("num learner:" + classifierList.size()); 
    171         _logger.trace("learner:" + classifierList); 
     170        _logger.trace("# of classifiers:" + classifierList.size()); 
     171        _logger.trace("classifiers:" + classifierList); 
    172172 
    173173        // read the test data 
     
    194194            } 
    195195 
    196             _logger.trace("sample: " + i + "\tfinal=" + finalPrediction + "\tlowerBound =" + lowerBound); 
     196            _logger.trace(String.format("sample %2d: finalPrediction=%2.3f, lowerBound=%2.3f", i, finalPrediction, 
     197                    lowerBound)); 
    197198 
    198199            // if the final prediction value is greater than or equal to the lower bound, use the  
     
    203204        } 
    204205 
    205         _logger.trace(prediction); 
     206        _logger.trace("prediction result: " + prediction); 
    206207 
    207208        // report the prediction 
     
    211212        } 
    212213    } 
    213  
    214214} 
  • sandbox/trunk/AdaBoost/src/org/xerial/mining/adaboost/WeakClassifier.java

    r2210 r2213  
    133133        bestClassifier.isValid = true; 
    134134 
    135         _logger.trace("classifier: " + bestClassifier.toString() + " error= " + bestClassifier.getErrorRatio() 
     135        _logger.trace("best classifier: " + bestClassifier.toString() + " error= " + bestClassifier.getErrorRatio() 
    136136                + ", beta= " + bestClassifier.getBetaValue()); 
    137137 
     
    187187    public String toString() 
    188188    { 
    189         return "col=" + testColumnIndex + " on " + returnsTrueWhenTestIsTrue; 
     189        return String.format("(col=%d is %s => true)", testColumnIndex, returnsTrueWhenTestIsTrue); 
    190190    } 
    191191} 
  • sandbox/trunk/AdaBoost/src/org/xerial/util/log/Logger.java

    r2210 r2213  
    259259        try 
    260260        { 
    261             logOut.write("["); 
    262             logOut.write(logLevel.toString()); 
    263             logOut.write("]"); 
    264             logOut.write("<"); 
    265             logOut.write(_loggerShortName); 
    266             logOut.write(">\t"); 
     261            logOut.write("[" + _loggerShortName + "]\t"); 
     262            //logOut.write(String.format("%5s", logLevel.toString())); 
     263            //logOut.write(" ["); 
     264            //logOut.write(_loggerShortName); 
     265            //logOut.write("]\t"); 
    267266            if (message != null) 
    268267                logOut.write(message.toString());