confusionmatrix.html

来自「weka是机器学习和数据挖掘领域最有影响力的开源项目之一」· HTML 代码 · 共 578 行 · 第 1/2 页

HTML
578
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_10) on Fri Jan 26 16:34:43 NZDT 2007 --><TITLE>ConfusionMatrix</TITLE><META NAME="keywords" CONTENT="weka.classifiers.evaluation.ConfusionMatrix class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="ConfusionMatrix";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="http://www.cs.waikato.ac.nz/ml/weka/" target="_blank"><FONT CLASS="NavBarFont1"><B>Weka's home</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;PREV CLASS&nbsp;&nbsp;<A HREF="../../../weka/classifiers/evaluation/CostCurve.html" title="class in weka.classifiers.evaluation"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html?weka/classifiers/evaluation/ConfusionMatrix.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="ConfusionMatrix.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">weka.classifiers.evaluation</FONT><BR>Class ConfusionMatrix</H2><PRE>java.lang.Object  <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../weka/core/Matrix.html" title="class in weka.core">weka.core.Matrix</A>      <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>weka.classifiers.evaluation.ConfusionMatrix</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, java.lang.Cloneable</DD></DL><HR><DL><DT><PRE>public class <B>ConfusionMatrix</B><DT>extends <A HREF="../../../weka/core/Matrix.html" title="class in weka.core">Matrix</A></DL></PRE><P>Cells of this matrix correspond to counts of the number (or weight) of predictions for each actual value / predicted value combination.<P><P><DL><DT><B>Version:</B></DT>  <DD>$Revision: 1.6 $</DD><DT><B>Author:</B></DT>  <DD>Len Trigg (len@reeltwo.com)</DD><DT><B>See Also:</B><DD><A HREF="../../../serialized-form.html#weka.classifiers.evaluation.ConfusionMatrix">Serialized Form</A></DL><HR><P><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#ConfusionMatrix(java.lang.String[])">ConfusionMatrix</A></B>(java.lang.String[]&nbsp;classNames)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates the confusion matrix with the given class names.</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#addPrediction(weka.classifiers.evaluation.NominalPrediction)">addPrediction</A></B>(<A HREF="../../../weka/classifiers/evaluation/NominalPrediction.html" title="class in weka.classifiers.evaluation">NominalPrediction</A>&nbsp;pred)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Includes a prediction in the confusion matrix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#addPredictions(weka.core.FastVector)">addPredictions</A></B>(<A HREF="../../../weka/core/FastVector.html" title="class in weka.core">FastVector</A>&nbsp;predictions)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Includes a whole bunch of predictions in the confusion matrix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#className(int)">className</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the name of one of the classes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.Object</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#clone()">clone</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates and returns a clone of this object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#correct()">correct</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the number of correct classifications (that is, for which a correct prediction was made).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#errorRate()">errorRate</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the estimated error rate.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../weka/classifiers/evaluation/TwoClassStats.html" title="class in weka.classifiers.evaluation">TwoClassStats</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#getTwoClassStats(int)">getTwoClassStats</A></B>(int&nbsp;classIndex)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the performance with respect to one of the classes as a TwoClassStats object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#incorrect()">incorrect</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the number of incorrect classifications (that is, for which an incorrect prediction was made).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html" title="class in weka.classifiers.evaluation">ConfusionMatrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#makeWeighted(weka.classifiers.CostMatrix)">makeWeighted</A></B>(<A HREF="../../../weka/classifiers/CostMatrix.html" title="class in weka.classifiers">CostMatrix</A>&nbsp;costs)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Makes a copy of this ConfusionMatrix after applying the supplied CostMatrix to the cells.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#size()">size</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the number of classes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calls toString() with a default title.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#toString(java.lang.String)">toString</A></B>(java.lang.String&nbsp;title)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Outputs the performance statistics as a classification confusion matrix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/evaluation/ConfusionMatrix.html#total()">total</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the number of predictions that were made (actually the sum of the weights of predictions where the class value was known).</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_weka.core.Matrix"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class weka.core.<A HREF="../../../weka/core/Matrix.html" title="class in weka.core">Matrix</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../weka/core/Matrix.html#add(weka.core.Matrix)">add</A>, <A HREF="../../../weka/core/Matrix.html#addElement(int, int, double)">addElement</A>, <A HREF="../../../weka/core/Matrix.html#eigenvalueDecomposition(double[][], double[])">eigenvalueDecomposition</A>, <A HREF="../../../weka/core/Matrix.html#getColumn(int)">getColumn</A>, <A HREF="../../../weka/core/Matrix.html#getElement(int, int)">getElement</A>, <A HREF="../../../weka/core/Matrix.html#getL()">getL</A>, <A HREF="../../../weka/core/Matrix.html#getRow(int)">getRow</A>, <A HREF="../../../weka/core/Matrix.html#getU()">getU</A>, <A HREF="../../../weka/core/Matrix.html#isSymmetric()">isSymmetric</A>, <A HREF="../../../weka/core/Matrix.html#LUDecomposition()">LUDecomposition</A>, <A HREF="../../../weka/core/Matrix.html#main(java.lang.String[])">main</A>, <A HREF="../../../weka/core/Matrix.html#multiply(weka.core.Matrix)">multiply</A>, <A HREF="../../../weka/core/Matrix.html#numColumns()">numColumns</A>, <A HREF="../../../weka/core/Matrix.html#numRows()">numRows</A>, <A HREF="../../../weka/core/Matrix.html#parseMatlab(java.lang.String)">parseMatlab</A>, <A HREF="../../../weka/core/Matrix.html#regression(weka.core.Matrix, double)">regression</A>, <A HREF="../../../weka/core/Matrix.html#regression(weka.core.Matrix, double[], double)">regression</A>, <A HREF="../../../weka/core/Matrix.html#setColumn(int, double[])">setColumn</A>, <A HREF="../../../weka/core/Matrix.html#setElement(int, int, double)">setElement</A>, <A HREF="../../../weka/core/Matrix.html#setRow(int, double[])">setRow</A>, <A HREF="../../../weka/core/Matrix.html#solve(double[])">solve</A>, <A HREF="../../../weka/core/Matrix.html#toMatlab()">toMatlab</A>, <A HREF="../../../weka/core/Matrix.html#transpose()">transpose</A>, <A HREF="../../../weka/core/Matrix.html#write(java.io.Writer)">write</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD></TR></TABLE>&nbsp;<P><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="ConfusionMatrix(java.lang.String[])"><!-- --></A><H3>ConfusionMatrix</H3><PRE>public <B>ConfusionMatrix</B>(java.lang.String[]&nbsp;classNames)</PRE>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?