edu.udo.cs.yale.operator.learner.meta
Class ContingencyMatrix
java.lang.Object
edu.udo.cs.yale.operator.learner.meta.ContingencyMatrix
public class ContingencyMatrix
- extends java.lang.Object
This class computes the contingency matrix of classifiers, supports weighted
example sets and contains some convenience methods to query for some
evaluation metrics that can directly be computed from this matrix.
- Version:
- $Id: ContingencyMatrix.java,v 1.4 2006/04/14 15:04:22 ingomierswa
Exp $
- Author:
- Martin Scholz
Constructor Summary |
ContingencyMatrix(double[][] contigencyMatrix)
The contigency matrix in the format [true label][predicted label]
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
matrix
private final double[][] matrix
rowSums
private final double[] rowSums
colSums
private final double[] colSums
total
private final double total
ContingencyMatrix
public ContingencyMatrix(double[][] contigencyMatrix)
- The contigency matrix in the format [true label][predicted label]
- Parameters:
contigencyMatrix
-
getMatrix
public double[][] getMatrix()
getNumberOfClasses
public int getNumberOfClasses()
getNumberOfPredictions
public int getNumberOfPredictions()
getPriors
public double[] getPriors()
getPrior
public double getPrior(int trueLabel)
getCoverage
public double getCoverage(int predictedLabel)
getProbability
public double getProbability(int trueLabel,
int predictedLabel)
getPrecision
public double getPrecision(int trueLabel,
int predictedLabel)
getLift
public double getLift(int trueLabel,
int predictedLabel)
getLiftRatio
public double getLiftRatio(int trueLabel,
int predictedLabel)
getLiftRatiosForPrediction
public double[] getLiftRatiosForPrediction(int predictedLabel)
getAccuracy
public double getAccuracy()
getErrorRate
public double getErrorRate()
getTotalWeight
public double getTotalWeight()
clone
public ContingencyMatrix clone()
- Overrides:
clone
in class java.lang.Object
Copyright © 2001-2006