⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 evaluation.html

📁 weka是机器学习和数据挖掘领域最有影响力的开源项目之一
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!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:41 NZDT 2007 --><TITLE>Evaluation</TITLE><META NAME="keywords" CONTENT="weka.classifiers.Evaluation class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="Evaluation";}</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;<A HREF="../../weka/classifiers/EnsembleLibraryModelComparator.html" title="class in weka.classifiers"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../weka/classifiers/IntervalEstimator.html" title="interface in weka.classifiers"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html?weka/classifiers/Evaluation.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Evaluation.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</FONT><BR>Class Evaluation</H2><PRE>java.lang.Object  <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>weka.classifiers.Evaluation</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../weka/core/Summarizable.html" title="interface in weka.core">Summarizable</A></DD></DL><HR><DL><DT><PRE>public class <B>Evaluation</B><DT>extends java.lang.Object<DT>implements <A HREF="../../weka/core/Summarizable.html" title="interface in weka.core">Summarizable</A></DL></PRE><P>Class for evaluating machine learning models. <p/> ------------------------------------------------------------------- <p/> General options when evaluating a learning scheme from the command-line: <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/> Preserves the order in the percentage split. <p/> -s seed <br/> Random number seed for the cross-validation (default: 1). <p/> -m filename <br/> The name of a file containing a cost matrix. <p/> -l filename <br/> Loads classifier from the given file. In case the filename ends with ".xml"  the options are loaded from XML. <p/> -d filename <br/> Saves classifier built from the training data into the given file. In case  the filename ends with ".xml" the options are saved XML, not the model. <p/> -v <br/> Outputs no statistics for the training data. <p/> -o <br/> Outputs statistics only, not the classifier. <p/>  -i <br/> Outputs information-retrieval statistics per class. <p/> -k <br/> Outputs information-theoretic statistics. <p/> -p range <br/> Outputs predictions for test instances (or the train instances if no test instances provided), along with the attributes in the specified range  (and nothing else). Use '-p 0' if no attributes are desired. <p/>  -distribution <br/> Outputs the distribution instead of only the prediction in conjunction with the '-p' option (only nominal classes). <p/> -r <br/> Outputs cumulative margin distribution (and nothing else). <p/> -g <br/>  Only for classifiers that implement "Graphable." Outputs the graph representation of the classifier (and nothing else). <p/>  -xml filename | xml-string <br/> Retrieves the options from the XML-data instead of the command line. <p/> ------------------------------------------------------------------- <p/> Example usage as the main of a classifier (called FunkyClassifier): <code> <pre> public static void main(String [] args) {   runClassifier(new FunkyClassifier(), args); } </pre> </code>  <p/> ------------------------------------------------------------------ <p/> Example usage from within an application: <code> <pre> Instances trainInstances = ... instances got from somewhere Instances testInstances = ... instances got from somewhere Classifier scheme = ... scheme got from somewhere Evaluation evaluation = new Evaluation(trainInstances); evaluation.evaluateModel(scheme, testInstances); System.out.println(evaluation.toSummaryString()); </pre> </code><P><P><DL><DT><B>Version:</B></DT>  <DD>$Revision: 1.73 $</DD><DT><B>Author:</B></DT>  <DD>Eibe Frank (eibe@cs.waikato.ac.nz), Len Trigg (trigg@cs.waikato.ac.nz)</DD></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.html#Evaluation(weka.core.Instances)">Evaluation</A></B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes all the counters for the evaluation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#Evaluation(weka.core.Instances, weka.classifiers.CostMatrix)">Evaluation</A></B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;data,           <A HREF="../../weka/classifiers/CostMatrix.html" title="class in weka.classifiers">CostMatrix</A>&nbsp;costMatrix)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes all the counters for the evaluation and also takes a cost matrix as parameter.</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;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#areaUnderROC(int)">areaUnderROC</A></B>(int&nbsp;classIndex)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the area under ROC for those predictions that have been collected in the evaluateClassifier(Classifier, Instances) method.</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.html#avgCost()">avgCost</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the average cost, that is, total cost of misclassifications (incorrect plus unclassified) over the total number of instances.</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.html#confusionMatrix()">confusionMatrix</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a copy of the 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.html#correct()">correct</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the number of instances correctly classified (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.html#correlationCoefficient()">correlationCoefficient</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the correlation coefficient if the class is numeric.</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.html#crossValidateModel(weka.classifiers.Classifier, weka.core.Instances, int, java.util.Random)">crossValidateModel</A></B>(<A HREF="../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A>&nbsp;classifier,                   <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;data,                   int&nbsp;numFolds,                   java.util.Random&nbsp;random)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Performs a (stratified if class is nominal) cross-validation  for a classifier on a set of instances.</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.html#crossValidateModel(java.lang.String, weka.core.Instances, int, java.lang.String[], java.util.Random)">crossValidateModel</A></B>(java.lang.String&nbsp;classifierString,                   <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;data,                   int&nbsp;numFolds,                   java.lang.String[]&nbsp;options,                   java.util.Random&nbsp;random)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Performs a (stratified if class is nominal) cross-validation  for a classifier on a set of instances.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#equals(java.lang.Object)">equals</A></B>(java.lang.Object&nbsp;obj)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests whether the current evaluation object is equal to another evaluation 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.html#errorRate()">errorRate</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the estimated error rate or the root mean squared error (if the class is numeric).</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.html#evaluateModel(weka.classifiers.Classifier, weka.core.Instances)">evaluateModel</A></B>(<A HREF="../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A>&nbsp;classifier,              <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Evaluates the classifier on a given set of instances.</TD></TR>

⌨️ 快捷键说明

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