类 ConfusionMatrix
java.lang.Object
weka.core.Matrix
weka.classifiers.evaluation.ConfusionMatrix
- 所有已实现的接口:
Serializable
,Cloneable
,RevisionHandler
Cells of this matrix correspond to counts of the number (or weight)
of predictions for each actual value / predicted value combination.
- 版本:
- $Revision: 1.9 $
- 作者:
- Len Trigg (len@reeltwo.com)
- 另请参阅:
-
构造器概要
构造器构造器说明ConfusionMatrix
(String[] classNames) Creates the confusion matrix with the given class names. -
方法概要
修饰符和类型方法说明void
Includes a prediction in the confusion matrix.void
addPredictions
(FastVector predictions) Includes a whole bunch of predictions in the confusion matrix.className
(int index) Gets the name of one of the classes.clone()
Creates and returns a clone of this object.double
correct()
Gets the number of correct classifications (that is, for which a correct prediction was made).double
Returns the estimated error rate.Returns the revision string.getTwoClassStats
(int classIndex) Gets the performance with respect to one of the classes as a TwoClassStats object.double
Gets the number of incorrect classifications (that is, for which an incorrect prediction was made).makeWeighted
(CostMatrix costs) Makes a copy of this ConfusionMatrix after applying the supplied CostMatrix to the cells.int
size()
Gets the number of classes.toString()
Calls toString() with a default title.Outputs the performance statistics as a classification confusion matrix.double
total()
Gets the number of predictions that were made (actually the sum of the weights of predictions where the class value was known).从类继承的方法 weka.core.Matrix
add, addElement, eigenvalueDecomposition, getColumn, getElement, getL, getRow, getU, isSymmetric, LUDecomposition, main, multiply, numColumns, numRows, parseMatlab, regression, regression, setColumn, setElement, setRow, solve, toMatlab, transpose, write
-
构造器详细资料
-
ConfusionMatrix
Creates the confusion matrix with the given class names.- 参数:
classNames
- an array containing the names the classes.
-
-
方法详细资料
-
makeWeighted
Makes a copy of this ConfusionMatrix after applying the supplied CostMatrix to the cells. The resulting ConfusionMatrix can be used to get cost-weighted statistics.- 参数:
costs
- the CostMatrix.- 返回:
- a ConfusionMatrix that has had costs applied.
- 抛出:
Exception
- if the CostMatrix is not of the same size as this ConfusionMatrix.
-
clone
Creates and returns a clone of this object. -
size
public int size()Gets the number of classes.- 返回:
- the number of classes
-
className
Gets the name of one of the classes.- 参数:
index
- the index of the class.- 返回:
- the class name.
-
addPrediction
Includes a prediction in the confusion matrix.- 参数:
pred
- the NominalPrediction to include- 抛出:
Exception
- if no valid prediction was made (i.e. unclassified).
-
addPredictions
Includes a whole bunch of predictions in the confusion matrix.- 参数:
predictions
- a FastVector containing the NominalPredictions to include- 抛出:
Exception
- if no valid prediction was made (i.e. unclassified).
-
getTwoClassStats
Gets the performance with respect to one of the classes as a TwoClassStats object.- 参数:
classIndex
- the index of the class of interest.- 返回:
- the generated TwoClassStats object.
-
correct
public double correct()Gets the number of correct classifications (that is, for which a correct prediction was made). (Actually the sum of the weights of these classifications)- 返回:
- the number of correct classifications
-
incorrect
public double incorrect()Gets the number of incorrect classifications (that is, for which an incorrect prediction was made). (Actually the sum of the weights of these classifications)- 返回:
- the number of incorrect classifications
-
total
public double total()Gets the number of predictions that were made (actually the sum of the weights of predictions where the class value was known).- 返回:
- the number of predictions with known class
-
errorRate
public double errorRate()Returns the estimated error rate.- 返回:
- the estimated error rate (between 0 and 1).
-
toString
Calls toString() with a default title. -
toString
Outputs the performance statistics as a classification confusion matrix. For each class value, shows the distribution of predicted class values.- 参数:
title
- the title for the confusion matrix- 返回:
- the confusion matrix as a String
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中Matrix
- 返回:
- the revision
-