classifier.html
来自「由java开发的软件包」· HTML 代码 · 共 598 行 · 第 1/2 页
HTML
598 行
<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - set of instances serving as training data<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if the classifier has not been generated successfully</DL></DD></DL><HR><A NAME="classifyInstance(weka.core.Instance)"><!-- --></A><H3>classifyInstance</H3><PRE>public double <B>classifyInstance</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance) throws java.lang.Exception</PRE><DL><DD>Classifies the given test instance. The instance has to belong to a dataset when it's being classified. Note that a classifier MUST implement either this or distributionForInstance().<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the instance to be classified<DT><B>Returns:</B><DD>the predicted most likely class for the instance or Instance.missingValue() if no prediction is made<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if an error occurred during the prediction</DL></DD></DL><HR><A NAME="distributionForInstance(weka.core.Instance)"><!-- --></A><H3>distributionForInstance</H3><PRE>public double[] <B>distributionForInstance</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance) throws java.lang.Exception</PRE><DL><DD>Predicts the class memberships for a given instance. If an instance is unclassified, the returned array elements must be all zero. If the class is numeric, the array must consist of only one element, which contains the predicted value. Note that a classifier MUST implement either this or classifyInstance().<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the instance to be classified<DT><B>Returns:</B><DD>an array containing the estimated membership probabilities of the test instance in each class or the numeric prediction<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if distribution could not be computed successfully</DL></DD></DL><HR><A NAME="forName(java.lang.String, java.lang.String[])"><!-- --></A><H3>forName</H3><PRE>public static <A HREF="../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A> <B>forName</B>(java.lang.String classifierName, java.lang.String[] options) throws java.lang.Exception</PRE><DL><DD>Creates a new instance of a classifier given it's class name and (optional) arguments to pass to it's setOptions method. If the classifier implements OptionHandler and the options parameter is non-null, the classifier will have it's options set.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>classifierName</CODE> - the fully qualified class name of the classifier<DD><CODE>options</CODE> - an array of options suitable for passing to setOptions. May be null.<DT><B>Returns:</B><DD>the newly created classifier, ready for use.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if the classifier name is invalid, or the options supplied are not acceptable to the classifier</DL></DD></DL><HR><A NAME="makeCopy(weka.classifiers.Classifier)"><!-- --></A><H3>makeCopy</H3><PRE>public static <A HREF="../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A> <B>makeCopy</B>(<A HREF="../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A> model) throws java.lang.Exception</PRE><DL><DD>Creates a deep copy of the given classifier using serialization.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>model</CODE> - the classifier to copy<DT><B>Returns:</B><DD>a deep copy of the classifier<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if an error occurs</DL></DD></DL><HR><A NAME="makeCopies(weka.classifiers.Classifier, int)"><!-- --></A><H3>makeCopies</H3><PRE>public static <A HREF="../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A>[] <B>makeCopies</B>(<A HREF="../../weka/classifiers/Classifier.html" title="class in weka.classifiers">Classifier</A> model, int num) throws java.lang.Exception</PRE><DL><DD>Creates a given number of deep copies of the given classifier using serialization.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>model</CODE> - the classifier to copy<DD><CODE>num</CODE> - the number of classifier copies to create.<DT><B>Returns:</B><DD>an array of classifiers.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if an error occurs</DL></DD></DL><HR><A NAME="listOptions()"><!-- --></A><H3>listOptions</H3><PRE>public java.util.Enumeration <B>listOptions</B>()</PRE><DL><DD>Returns an enumeration describing the available options.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/OptionHandler.html#listOptions()">listOptions</A></CODE> in interface <CODE><A HREF="../../weka/core/OptionHandler.html" title="interface in weka.core">OptionHandler</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an enumeration of all the available options.</DL></DD></DL><HR><A NAME="setOptions(java.lang.String[])"><!-- --></A><H3>setOptions</H3><PRE>public void <B>setOptions</B>(java.lang.String[] options) throws java.lang.Exception</PRE><DL><DD>Parses a given list of options. Valid options are:<p> -D <br> If set, classifier is run in debug mode and may output additional info to the console.<p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/OptionHandler.html#setOptions(java.lang.String[])">setOptions</A></CODE> in interface <CODE><A HREF="../../weka/core/OptionHandler.html" title="interface in weka.core">OptionHandler</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>options</CODE> - the list of options as an array of strings<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if an option is not supported</DL></DD></DL><HR><A NAME="getOptions()"><!-- --></A><H3>getOptions</H3><PRE>public java.lang.String[] <B>getOptions</B>()</PRE><DL><DD>Gets the current settings of the Classifier.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/OptionHandler.html#getOptions()">getOptions</A></CODE> in interface <CODE><A HREF="../../weka/core/OptionHandler.html" title="interface in weka.core">OptionHandler</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an array of strings suitable for passing to setOptions</DL></DD></DL><HR><A NAME="setDebug(boolean)"><!-- --></A><H3>setDebug</H3><PRE>public void <B>setDebug</B>(boolean debug)</PRE><DL><DD>Set debugging mode.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>debug</CODE> - true if debug output should be printed</DL></DD></DL><HR><A NAME="getDebug()"><!-- --></A><H3>getDebug</H3><PRE>public boolean <B>getDebug</B>()</PRE><DL><DD>Get whether debugging is turned on.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if debugging output is on</DL></DD></DL><HR><A NAME="debugTipText()"><!-- --></A><H3>debugTipText</H3><PRE>public java.lang.String <B>debugTipText</B>()</PRE><DL><DD>Returns the tip text for this property<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>tip text for this property suitable for displaying in the explorer/experimenter gui</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_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> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../Tutorial.pdf"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="http://www.cs.waikato.ac.nz/ml/weka/index.html"><FONT CLASS="NavBarFont1"><B>Weka's home</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../weka/classifiers/CheckClassifier.html" title="class in weka.classifiers"><B>PREV CLASS</B></A> <A HREF="../../weka/classifiers/CostMatrix.html" title="class in weka.classifiers"><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> <A HREF="Classifier.html" target="_top"><B>NO FRAMES</B></A> <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?