filter.html

来自「由java开发的软件包」· HTML 代码 · 共 689 行 · 第 1/3 页

HTML
689
字号
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Main method for testing this class.</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/filters/Filter.html#numPendingOutput()">numPendingOutput</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of instances pending output</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#output()">output</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Output an instance after filtering and remove from the output queue.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#outputFormat()">outputFormat</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>use <code>getOutputFormat()</code> instead.</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#outputPeek()">outputPeek</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Output an instance after filtering but do not remove from the output queue.</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/filters/Filter.html#setInputFormat(weka.core.Instances)">setInputFormat</A></B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;instanceInfo)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the format of the input instances.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#useFilter(weka.core.Instances, weka.filters.Filter)">useFilter</A></B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;data,          <A HREF="../../weka/filters/Filter.html" title="class in weka.filters">Filter</A>&nbsp;filter)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Filters an entire set of instances through a filter and returns the new set.</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"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Filter()"><!-- --></A><H3>Filter</H3><PRE>public <B>Filter</B>()</PRE><DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="inputFormat(weka.core.Instances)"><!-- --></A><H3>inputFormat</H3><PRE>public boolean <B>inputFormat</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;instanceInfo)                    throws java.lang.Exception</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>use <code>setInputFormat(Instances)</code> instead.</I><P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="setInputFormat(weka.core.Instances)"><!-- --></A><H3>setInputFormat</H3><PRE>public boolean <B>setInputFormat</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;instanceInfo)                       throws java.lang.Exception</PRE><DL><DD>Sets the format of the input instances. If the filter is able to determine the output format before seeing any input instances, it does so here. This default implementation clears the output format and output queue, and the new batch flag is set. Overriders should call <code>super.setInputFormat(Instances)</code><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>instanceInfo</CODE> - an Instances object containing the input instance structure (any instances contained in the object are ignored - only the structure is required).<DT><B>Returns:</B><DD>true if the outputFormat may be collected immediately<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if the inputFormat can't be set successfully</DL></DD></DL><HR><A NAME="outputFormat()"><!-- --></A><H3>outputFormat</H3><PRE>public <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>outputFormat</B>()</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>use <code>getOutputFormat()</code> instead.</I><P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="getOutputFormat()"><!-- --></A><H3>getOutputFormat</H3><PRE>public <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>getOutputFormat</B>()</PRE><DL><DD>Gets the format of the output instances. This should only be called after input() or batchFinished() has returned true. The relation name of the output instances should be changed to reflect the action of the filter (eg: add the filter name and options).<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an Instances object containing the output instance structure only.<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if no input structure has been defined (or the output format hasn't been determined yet)</DL></DD></DL><HR><A NAME="input(weka.core.Instance)"><!-- --></A><H3>input</H3><PRE>public boolean <B>input</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A>&nbsp;instance)              throws java.lang.Exception</PRE><DL><DD>Input an instance for filtering. Ordinarily the instance is processed and made available for output immediately. Some filters require all instances be read before producing output, in which case output instances should be collected after calling batchFinished(). If the input marks the start of a new batch, the output queue is cleared. This default implementation assumes all instance conversion will occur when batchFinished() is called.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the input instance<DT><B>Returns:</B><DD>true if the filtered instance may now be collected with output().<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if the input format has not been defined.<DD><CODE>java.lang.Exception</CODE> - if the input instance was not of the correct  format or if there was a problem with the filtering.</DL></DD></DL><HR><A NAME="batchFinished()"><!-- --></A><H3>batchFinished</H3><PRE>public boolean <B>batchFinished</B>()                      throws java.lang.Exception</PRE><DL><DD>Signify that this batch of input to the filter is finished. If the filter requires all instances prior to filtering, output() may now be called to retrieve the filtered instances. Any subsequent instances filtered should be filtered based on setting obtained from the first batch (unless the inputFormat has been re-assigned or new options have been set). This default implementation assumes all instance processing occurs during inputFormat() and input().<P><DD><DL></DL>

⌨️ 快捷键说明

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