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

com.bbn.bue.common.evaluation.BrokenDownProvenancedConfusionMatrix Maven / Gradle / Ivy

There is a newer version: 4.1.2
Show newest version
package com.bbn.bue.common.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 - 2024 Weber Informatics LLC | Privacy Policy