com.bbn.bue.common.evaluation.BrokenDownProvenancedConfusionMatrix Maven / Gradle / Ivy
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());
}
}