Changeset 2213
- Timestamp:
- 06/24/08 09:53:55 (4 years ago)
- Location:
- sandbox/trunk/AdaBoost/src/org/xerial
- Files:
-
- 3 modified
-
mining/adaboost/AdaBoost.java (modified) (4 diffs)
-
mining/adaboost/WeakClassifier.java (modified) (2 diffs)
-
util/log/Logger.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sandbox/trunk/AdaBoost/src/org/xerial/mining/adaboost/AdaBoost.java
r2210 r2213 168 168 List<Classifier> classifierList = prepareWeakClassifier(trainingDataFile); 169 169 170 _logger.trace(" num learner:" + classifierList.size());171 _logger.trace(" learner:" + classifierList);170 _logger.trace("# of classifiers:" + classifierList.size()); 171 _logger.trace("classifiers:" + classifierList); 172 172 173 173 // read the test data … … 194 194 } 195 195 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)); 197 198 198 199 // if the final prediction value is greater than or equal to the lower bound, use the … … 203 204 } 204 205 205 _logger.trace( prediction);206 _logger.trace("prediction result: " + prediction); 206 207 207 208 // report the prediction … … 211 212 } 212 213 } 213 214 214 } -
sandbox/trunk/AdaBoost/src/org/xerial/mining/adaboost/WeakClassifier.java
r2210 r2213 133 133 bestClassifier.isValid = true; 134 134 135 _logger.trace(" classifier: " + bestClassifier.toString() + " error= " + bestClassifier.getErrorRatio()135 _logger.trace("best classifier: " + bestClassifier.toString() + " error= " + bestClassifier.getErrorRatio() 136 136 + ", beta= " + bestClassifier.getBetaValue()); 137 137 … … 187 187 public String toString() 188 188 { 189 return "col=" + testColumnIndex + " on " + returnsTrueWhenTestIsTrue;189 return String.format("(col=%d is %s => true)", testColumnIndex, returnsTrueWhenTestIsTrue); 190 190 } 191 191 } -
sandbox/trunk/AdaBoost/src/org/xerial/util/log/Logger.java
r2210 r2213 259 259 try 260 260 { 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"); 267 266 if (message != null) 268 267 logOut.write(message.toString());


