Code example for Multiset

Methods: add

0
  /** 
   * Increments the entry specified by actual and predicted by count. 
   */ 
  public void add(T actual, T predicted, int count) {
    if (matrix.containsKey(actual)) {
      matrix.get(actual).add(predicted, count);
    } else { 
      Multiset<T> counts = HashMultiset.create();
      counts.add(predicted, count);
      matrix.put(actual, counts);
    } 
 
    classes.add(actual);
    classes.add(predicted);
  } 
 
  /** 
   * Adds the entries from another confusion matrix to this one. 
   */ 
  public void add(ConfusionMatrix<T> other) {