📄 evaluation.html
字号:
<TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#SFPriorEntropy()">SFPriorEntropy</A></B>()</CODE><BR> Returns the total entropy for the null model</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#SFSchemeEntropy()">SFSchemeEntropy</A></B>()</CODE><BR> Returns the total entropy for the scheme</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#toClassDetailsString()">toClassDetailsString</A></B>()</CODE><BR> Generates a breakdown of the accuracy for each class (with default title), incorporating various information-retrieval statistics, such as true/false positive rate, precision/recall/F-Measure.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#toClassDetailsString(java.lang.String)">toClassDetailsString</A></B>(java.lang.String title)</CODE><BR> Generates a breakdown of the accuracy for each class, incorporating various information-retrieval statistics, such as true/false positive rate, precision/recall/F-Measure.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#toCumulativeMarginDistributionString()">toCumulativeMarginDistributionString</A></B>()</CODE><BR> Output the cumulative margin distribution as a string suitable for input for gnuplot or similar package.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#toMatrixString()">toMatrixString</A></B>()</CODE><BR> Calls toMatrixString() with a default title.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#toMatrixString(java.lang.String)">toMatrixString</A></B>(java.lang.String title)</CODE><BR> 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> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#toSummaryString()">toSummaryString</A></B>()</CODE><BR> Calls toSummaryString() with no title and no complexity stats</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#toSummaryString(boolean)">toSummaryString</A></B>(boolean printComplexityStatistics)</CODE><BR> Calls toSummaryString() with a default title.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#toSummaryString(java.lang.String, boolean)">toSummaryString</A></B>(java.lang.String title, boolean printComplexityStatistics)</CODE><BR> Outputs the performance statistics in summary form.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#totalCost()">totalCost</A></B>()</CODE><BR> Gets the total cost, that is, the cost of each prediction times the weight of the instance, summed over all instances.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#trueNegativeRate(int)">trueNegativeRate</A></B>(int classIndex)</CODE><BR> Calculate the true negative rate with respect to a particular class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#truePositiveRate(int)">truePositiveRate</A></B>(int classIndex)</CODE><BR> Calculate the true positive rate with respect to a particular class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#unclassified()">unclassified</A></B>()</CODE><BR> Gets the number of instances not classified (that is, for which no prediction was made by the classifier).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#updatePriors(weka.core.Instance)">updatePriors</A></B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance)</CODE><BR> Updates the class prior probabilities (when incrementally training)</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#useNoPriors()">useNoPriors</A></B>()</CODE><BR> disables the use of priors, e.g., in case of de-serialized schemes that have no access to the original training set, but are evaluated on a set set.</TD></TR></TABLE> <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>getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <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="Evaluation(weka.core.Instances)"><!-- --></A><H3>Evaluation</H3><PRE>public <B>Evaluation</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> data) throws java.lang.Exception</PRE><DL><DD>Initializes all the counters for the evaluation. Use <code>useNoPriors()</code> if the dataset is the test set and you can't initialize with the priors from the training set via <code>setPriors(Instances)</code>.<P><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - set of training instances, to get some header information and prior class distribution information<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if the class is not defined<DT><B>See Also:</B><DD><A HREF="../../weka/classifiers/Evaluation.html#useNoPriors()"><CODE>useNoPriors()</CODE></A>, <A HREF="../../weka/classifiers/Evaluation.html#setPriors(weka.core.Instances)"><CODE>setPriors(Instances)</CODE></A></DL></DL><HR><A NAME="Evaluation(weka.core.Instances, weka.classifiers.CostMatrix)"><!-- --></A><H3>Evaluation</H3><PRE>public <B>Evaluation</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> data, <A HREF="../../weka/classifiers/CostMatrix.html" title="class in weka.classifiers">CostMatrix</A> costMatrix) throws java.lang.Exception</PRE><DL><DD>Initializes all the counters for the evaluation and also takes a cost matrix as parameter. Use <code>useNoPriors()</code> if the dataset is the test set and you can't initialize with the priors from the training set via <code>setPriors(Instances)</code>.<P><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - set of training instances, to get some header information and prior class distribution information<DD><CODE>costMatrix</CODE> - the cost matrix---if null, default costs will be used<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if cost matrix is not compatible with data, the class is not defined or the class is numeric<DT><B>See Also:</B><DD><A HREF="../../weka/classifiers/Evaluation.html#useNoPriors()"><CODE>useNoPriors()</CODE></A>, <A HREF="../../weka/classifiers/Evaluation.html#setPriors(weka.core.Instances)"><CODE>setPriors(Instances)</CODE></A></DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_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>Method Detail</B></FONT></TH></TR></TABLE><A NAME="areaUnderROC(int)"><!-- --></A><H3>areaUnderROC</H3><PRE>public double <B>areaUnderROC</B>(int classIndex)</PRE><DL><DD>Returns the area under ROC for those predictions that have been collected in the evaluateClassifier(Classifier, Instances) method. Returns Instance.missingValue() if the area is not available.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>classIndex</CODE> - the index of the class to consider as "positive"<DT><B>Returns:</B><DD>the area under the ROC curve or not a number</DL></DD></DL><HR><A NAME="confusionMatrix()"><!-- --></A><H3>confusionMatrix</H3><PRE>public double[][] <B>confusionMatrix</B>()</PRE><DL><DD>Returns a copy of the confusion matrix.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a copy of the confusion matrix as a two-dimensional array</DL></DD></DL><HR><A NAME="crossValidateModel(weka.classifiers.Classifier, weka.core.Instances, int, java.util.Random)"><!-- --></A><H3>crossValidateModel</H3><PRE>public void <B>crossValidateModel</B>(<A HREF="../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A> classifier, <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> data, int numFolds, java.util.Random random) throws java.lang.Exception</PRE><DL><DD>Performs a (stratified if class is nominal) cross-validation for a classifier on a set of instances. Now performs a deep copy of the classifier before each call to buildClassifier() (just in case the classifier is not initialized properly).<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>classifier</CODE> - the classifier with any options set.<DD><CODE>data</CODE> - the data on which the cross-validation is to be performed<DD><CODE>numFolds</CODE> - the number of folds for the cross-validation<DD><CODE>random</CODE> - random number generator for randomization<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if a classifier could not be generated successfully or the class is not defined</DL></DD></DL><HR><A NAME="crossValidateModel(java.lang.String, weka.core.Instances, int, java.lang.String[], java.util.Random)"><!-- --></A><H3>crossValidateModel</H3><PRE>public void <B>crossValidateModel</B>(java.lang.String classifierString, <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> data, int numFolds, java.lang.String[] options, java.util.Random random) throws java.lang.Exception</PRE><DL><DD>Performs a (stratified if class is nominal) cross-validation for a classifier on a set of instances.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>classifierString</CODE> - a string naming the class of the classifier<DD><CODE>data</CODE> - the data on which the cross-validation is to be performed<DD><CODE>numFolds</CODE> - the number of folds for the cross-validation<DD><CODE>options</CODE> - the options to the classifier. Any options<DD><CODE>random</CODE> - the random number generator for randomizing the data accepted by the classifier will be removed from this array.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if a classifier could not be generated successfully or the class is not defined</DL></DD></DL><HR><A NAME="evaluateModel(java.lang.String, java.lang.String[])"><!-- --></A><H3>evaluateModel</H3><PRE>public static java.lang.String <B>evaluateModel</B>(java.lang.String classifierString, java.lang.String[] options) throws java.lang.Exception</PRE><DL><DD>Evaluates a classifier with the options given in an array of strings. <p/> Valid options are: <p/> -t filename <br/> Name of the file with the training data. (required) <p/> -T filename <br/> Name of the file with the test data. If missing a cross-validation is performed. <p/> -c index <br/> Index of the class attribute (1, 2, ...; default: last). <p/> -x number <br/> The number of folds for the cross-validation (default: 10). <p/> -no-cv <br/> No cross validation. If no test file is provided, no evaluation is done. <p/> -split-percentage percentage <br/> Sets the percentage for the train/test set split, e.g., 66. <p/> -preserve-order <br/>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -