@Override public void countExample(Example example){
  double plabel;
  double label=example.getValue(labelAttribute);
  if (!predictedAttribute.isNominal()) {
    plabel=example.getValue(predictedAttribute);
  }
 else {
    String labelS=example.getValueAsString(labelAttribute);
    plabel=example.getConfidence(labelS);
    label=1.0d;
  }
  double weight=1.0d;
  if (weightAttribute != null) {
    weight=example.getValue(weightAttribute);
  }
  double diff=weight * Math.abs(label - plabel);
  deviationSum+=diff;
  double relDiff=Math.abs(weight * label - (trueLabelSum / exampleCounter));
  relativeSum+=relDiff;
}

@ Override public void countExample ( Example example ) { double plabel ; double label = example . getValue ( labelAttribute ) ; if ( ! predictedAttribute . isNominal ( ) ) { plabel = example . getValue ( predictedAttribute ) ; } else { String labelS = example . getValueAsString ( labelAttribute ) ; plabel = example . getConfidence ( labelS ) ; label = 1.0d ; } double weight = 1.0d ; if ( weightAttribute != null ) { weight = example . getValue ( weightAttribute ) ; } double diff = weight * Math . abs ( label - plabel ) ; deviationSum += diff ; double relDiff = Math . abs ( weight * label - ( trueLabelSum / exampleCounter ) ) ; relativeSum += relDiff ; }
calculates the error for the current example .
