public final class ConfusionMatrix extends Object
| Modifier and Type | Method and Description | 
|---|---|
static ConfusionMatrix | 
create(DataReaderCommand readerCommand,
      String actual,
      String predicted,
      String caseWeight)
Initializes a new instance of the  
ConfusionMatrix class. | 
double | 
getAccuracy()
Gets the overall accuracy of the predictions, which is simply the  
getCorrectCount() divided by the getTotalCount(). | 
ConfusionMatrixCell | 
getCell(Comparable actualValue,
       Comparable predictedValue)
Gets information about a cell in a confusion matrix. 
 | 
double | 
getCorrectCount()
Gets the total number of correct predictions. 
 | 
List<Comparable> | 
getSortedUniqueValues()
Gets a sorted list of unique values which is the union of the different actual and predicted values found. 
 | 
double | 
getTotalCount()
Gets a count of the number of predictions, whether they were correct or not. 
 | 
public static ConfusionMatrix create(DataReaderCommand readerCommand, String actual, String predicted, String caseWeight)
ConfusionMatrix class.readerCommand - Returns the data containing the actual values and predicted values.actual - The name of the data column containing the actual value.predicted - The name of the data column containing the predicted value.caseWeight - The case weight, if any.  Can be null.public double getCorrectCount()
public double getTotalCount()
public double getAccuracy()
getCorrectCount() divided by the getTotalCount().public ConfusionMatrixCell getCell(Comparable actualValue, Comparable predictedValue)
actualValue - The actual value we want information about.predictedValue - The predicted value we want information about.ConfusionMatrixCell instance.public List<Comparable> getSortedUniqueValues()
Copyright © 2021. All rights reserved.