
com.github.lwhite1.tablesaw.api.ml.classification.StandardConfusionMatrix Maven / Gradle / Ivy
package com.github.lwhite1.tablesaw.api.ml.classification;
import com.github.lwhite1.tablesaw.api.CategoryColumn;
import com.github.lwhite1.tablesaw.api.IntColumn;
import com.google.common.collect.Table;
import com.google.common.collect.TreeBasedTable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
/**
* A confusion matrix is used to measure the accuracy of a classifier by counting the number of correct and
* incorrect values produced when testing the classifier such that the counts are made for every combination of
* correct and incorrect classification
*/
public class StandardConfusionMatrix implements ConfusionMatrix {
private final Table table = TreeBasedTable.create();
private SortedMap labels = new TreeMap<>();
public StandardConfusionMatrix(SortedSet
© 2015 - 2025 Weber Informatics LLC | Privacy Policy