filter.html
来自「数据挖掘的最常用工具。由于开源」· HTML 代码 · 共 885 行 · 第 1/3 页
HTML
885 行
<TD><CODE><B><A HREF="../../weka/filters/Filter.html#outputPeek()">outputPeek</A></B>()</CODE><BR> 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> 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> instanceInfo)</CODE><BR> 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> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#toString()">toString</A></B>()</CODE><BR> Returns a description of the filter, by default only the classname.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <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> data, <A HREF="../../weka/filters/Filter.html" title="class in weka.filters">Filter</A> filter)</CODE><BR> Filters an entire set of instances through a filter and returns the new set.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#wekaStaticWrapper(weka.filters.Sourcable, java.lang.String, weka.core.Instances, weka.core.Instances)">wekaStaticWrapper</A></B>(<A HREF="../../weka/filters/Sourcable.html" title="interface in weka.filters">Sourcable</A> filter, java.lang.String className, <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> input, <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> output)</CODE><BR> generates source code from the filter</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>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_weka.core.RevisionHandler"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from interface weka.core.<A HREF="../../weka/core/RevisionHandler.html" title="interface in weka.core">RevisionHandler</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../weka/core/RevisionHandler.html#getRevision()">getRevision</A></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="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"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="isNewBatch()"><!-- --></A><H3>isNewBatch</H3><PRE>public boolean <B>isNewBatch</B>()</PRE><DL><DD>Returns true if the a new batch was started, either a new instance of the filter was created or the batchFinished() method got called.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if a new batch has been initiated<DT><B>See Also:</B><DD><A HREF="../../weka/filters/Filter.html#m_NewBatch"><CODE>m_NewBatch</CODE></A>, <A HREF="../../weka/filters/Filter.html#batchFinished()"><CODE>batchFinished()</CODE></A></DL></DD></DL><HR><A NAME="isFirstBatchDone()"><!-- --></A><H3>isFirstBatchDone</H3><PRE>public boolean <B>isFirstBatchDone</B>()</PRE><DL><DD>Returns true if the first batch of instances got processed. Necessary for supervised filters, which "learn" from the first batch and then shouldn't get updated with subsequent calls of batchFinished().<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the first batch has been processed<DT><B>See Also:</B><DD><A HREF="../../weka/filters/Filter.html#m_FirstBatchDone"><CODE>m_FirstBatchDone</CODE></A>, <A HREF="../../weka/filters/Filter.html#batchFinished()"><CODE>batchFinished()</CODE></A></DL></DD></DL><HR><A NAME="getCapabilities()"><!-- --></A><H3>getCapabilities</H3><PRE>public <A HREF="../../weka/core/Capabilities.html" title="class in weka.core">Capabilities</A> <B>getCapabilities</B>()</PRE><DL><DD>Returns the Capabilities of this filter. Derived filters have to override this method to enable capabilities.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/CapabilitiesHandler.html#getCapabilities()">getCapabilities</A></CODE> in interface <CODE><A HREF="../../weka/core/CapabilitiesHandler.html" title="interface in weka.core">CapabilitiesHandler</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the capabilities of this object<DT><B>See Also:</B><DD><A HREF="../../weka/core/Capabilities.html" title="class in weka.core"><CODE>Capabilities</CODE></A></DL></DD></DL><HR><A NAME="getCapabilities(weka.core.Instances)"><!-- --></A><H3>getCapabilities</H3><PRE>public <A HREF="../../weka/core/Capabilities.html" title="class in weka.core">Capabilities</A> <B>getCapabilities</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> data)</PRE><DL><DD>Returns the Capabilities of this filter, customized based on the data. I.e., if removes all class capabilities, in case there's not class attribute present or removes the NO_CLASS capability, in case that there's a class present.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - the data to use for customization<DT><B>Returns:</B><DD>the capabilities of this object, based on the data<DT><B>See Also:</B><DD><A HREF="../../weka/filters/Filter.html#getCapabilities()"><CODE>getCapabilities()</CODE></A></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> 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="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> 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></DD><DD><DL><DT><B>Returns:</B><DD>true if there are instances pending output<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if no input structure has been defined,<DD><CODE>java.lang.Exception</CODE> - if there was a problem finishing the batch.</DL></DD></DL><HR><A NAME="output()"><!-- --></A><H3>output</H3><PRE>public <A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> <B>output</B>()</PRE><DL><DD>Output an instance after filtering and remove from the output queue.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the instance that has most recently been filtered (or null if the queue is empty).<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if no output structure has been defined</DL></DD></DL>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?