All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.isi.nlp.evaluation.BrokenDownProvenancedConfusionMatrix Maven / Gradle / Ivy

The newest version!
package edu.isi.nlp.evaluation;

import com.google.common.annotations.Beta;
import com.google.common.collect.ImmutableMap;
import java.util.Map;

@Beta
public final class BrokenDownProvenancedConfusionMatrix {

  private ImmutableMap> data;

  private BrokenDownProvenancedConfusionMatrix(
      Map> data) {
    this.data = ImmutableMap.copyOf(data);
  }

  public static  BrokenDownProvenancedConfusionMatrix fromMap(
      Map> data) {
    return new BrokenDownProvenancedConfusionMatrix(data);
  }

  public Map> asMap() {
    return data;
  }

  public BrokenDownSummaryConfusionMatrix toSummary() {
    final ImmutableMap.Builder ret = ImmutableMap.builder();
    for (final Map.Entry> entry :
        data.entrySet()) {
      ret.put(entry.getKey(), entry.getValue().buildSummaryMatrix());
    }
    return BrokenDownSummaryConfusionMatrix.fromMap(ret.build());
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy