/** * Gets a human readable representation of this prediction. * * @return a human readable representation of this prediction. */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("NOM: ").append(actual()).append(" ").append(predicted()); sb.append(' ').append(weight()); double [] dist = distribution(); for (int i = 0; i < dist.length; i++) { sb.append(' ').append(dist[i]); } return sb.toString(); }
/** * Gets a human readable representation of this prediction. * * @return a human readable representation of this prediction. */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("NOM: ").append(actual()).append(" ").append(predicted()); sb.append(' ').append(weight()); double [] dist = distribution(); for (int i = 0; i < dist.length; i++) { sb.append(' ').append(dist[i]); } return sb.toString(); }
continue; if (pred.weight() < 0) { System.err.println(getClass().getName() + " Skipping prediction with negative weight"); totPos += pred.weight(); } else { totNeg += pred.weight(); continue; if (pred.weight() < 0) { System.err.println(getClass().getName() + " Skipping prediction with negative weight"); cumulativePos += pred.weight(); } else { cumulativeNeg += pred.weight();
/** * Includes a prediction in the confusion matrix. * * @param pred the NominalPrediction to include * @exception Exception if no valid prediction was made (i.e. unclassified). */ public void addPrediction(NominalPrediction pred) throws Exception { if (pred.predicted() == NominalPrediction.MISSING_VALUE) { throw new Exception("No predicted value given."); } if (pred.actual() == NominalPrediction.MISSING_VALUE) { throw new Exception("No actual value given."); } set((int) pred.actual(), (int) pred.predicted(), get((int) pred.actual(), (int) pred.predicted()) + pred.weight()); }
/** * Includes a prediction in the confusion matrix. * * @param pred the NominalPrediction to include * @exception Exception if no valid prediction was made (i.e. unclassified). */ public void addPrediction(NominalPrediction pred) throws Exception { if (pred.predicted() == NominalPrediction.MISSING_VALUE) { throw new Exception("No predicted value given."); } if (pred.actual() == NominalPrediction.MISSING_VALUE) { throw new Exception("No actual value given."); } set((int) pred.actual(), (int) pred.predicted(), get((int) pred.actual(), (int) pred.predicted()) + pred.weight()); }
continue; if (pred.weight() < 0) { System.err.println(getClass().getName() + " Skipping prediction with negative weight"); totPos += pred.weight(); } else { totNeg += pred.weight(); continue; if (pred.weight() < 0) { System.err.println(getClass().getName() + " Skipping prediction with negative weight"); cumulativePos += pred.weight(); } else { cumulativeNeg += pred.weight();
for (int element : sorted) { double current = margins[element]; double weight = ((NominalPrediction) predictions.get(element)).weight(); totalMargin += weight; binMargin += weight;
for (int element : sorted) { double current = margins[element]; double weight = ((NominalPrediction) predictions.get(element)).weight(); totalMargin += weight; binMargin += weight;