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

📄 evaluation.html

📁 < 数据挖掘--实用机器学习技术及java实现> 一书结合数据挖掘和机器学习的知识,作者陈述了自动挖掘模式的基础理论,并且以java语言实现了具有代表性的各类数据挖掘方法.例如:class
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Wed Sep 04 10:31:49 CDT 2002 --><TITLE>: Class  Evaluation</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <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>  </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/DistributionMetaClassifier.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../weka/classifiers/EvaluationClient.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Evaluation.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&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><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">weka.classifiers</FONT><BR>Class  Evaluation</H2><PRE>java.lang.Object  |  +--<B>weka.classifiers.Evaluation</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, <A HREF="../../weka/core/Summarizable.html">Summarizable</A></DD></DL><HR><DL><DT>public class <B>Evaluation</B><DT>extends java.lang.Object<DT>implements <A HREF="../../weka/core/Summarizable.html">Summarizable</A>, java.io.Serializable</DL><P>Class for evaluating machine learning models. <p> Has been modified to run cross-validations in parallel for WEKA-PARALLEL.<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> -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. <p> -d filename <br> Saves classifier built from the training data into the given file. <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, along with the attributes in the specified range (and nothing else). Use '-p 0' if no attributes are desired. <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> -a <br> Causes the cross-validation portion of the program to occur in parallel on multiple machines specified in ~/.weka-parallel. <p> ------------------------------------------------------------------- <p> Example usage as the main of a classifier (called FunkyClassifier): <code> <pre> public static void main(String [] args) {   try {     Classifier scheme = new FunkyClassifier();     System.out.println(Evaluation.evaluateModel(scheme, args));   } catch (Exception e) {     System.err.println(e.getMessage());   } } </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><DL><DT><B>See Also: </B><DD><A HREF="../../serialized-form.html#weka.classifiers.Evaluation">Serialized Form</A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></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">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">Instances</A>&nbsp;data,           <A HREF="../../weka/classifiers/CostMatrix.html">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" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></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#aggregate(weka.classifiers.Evaluation)">aggregate</A></B>(<A HREF="../../weka/classifiers/Evaluation.html">Evaluation</A>&nbsp;evaluation)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Aggregates data obtained from running different folds on different machines.</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;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#classNames()">classNames</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a copy of the classNames array.</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#classPriors()">classPriors</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tells whether or not the class is nominal.</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#classPriorsSum()">classPriorsSum</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the value of the classPriorsSum variable</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;<A HREF="../../weka/classifiers/CostMatrix.html">CostMatrix</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/classifiers/Evaluation.html#costMatrix()">costMatrix</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets a copy of the cost 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.html#crossValidateModel(weka.classifiers.Classifier, weka.core.Instances, int)">crossValidateModel</A></B>(<A HREF="../../weka/classifiers/Classifier.html">Classifier</A>&nbsp;classifier,                   <A HREF="../../weka/core/Instances.html">Instances</A>&nbsp;data,                   int&nbsp;numFolds)</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[])">crossValidateModel</A></B>(java.lang.String&nbsp;classifierString,                   <A HREF="../../weka/core/Instances.html">Instances</A>&nbsp;data,                   int&nbsp;numFolds,                   java.lang.String[]&nbsp;options)</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#crossValidateModelParallel(weka.classifiers.Classifier, weka.core.Instances, int, java.lang.StringBuffer)">crossValidateModelParallel</A></B>(<A HREF="../../weka/classifiers/Classifier.html">Classifier</A>&nbsp;classifier,                           <A HREF="../../weka/core/Instances.html">Instances</A>&nbsp;data,                           int&nbsp;numFolds,                           java.lang.StringBuffer&nbsp;otherComputers)</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;void</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">Classifier</A>&nbsp;classifier,              <A HREF="../../weka/core/Instances.html">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><TR BGCOLOR="white" CLASS="TableRowColor">

⌨️ 快捷键说明

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