📄 filter.html
字号:
<!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:52 NZDT 2007 --><TITLE>Filter</TITLE><META NAME="keywords" CONTENT="weka.filters.Filter class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="Filter";}</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> </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="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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> </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/filters/AllFilter.html" title="class in weka.filters"><B>PREV CLASS</B></A> <A HREF="../../weka/filters/MultiFilter.html" title="class in weka.filters"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?weka/filters/Filter.html" target="_top"><B>FRAMES</B></A> <A HREF="Filter.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_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">weka.filters</FONT><BR>Class Filter</H2><PRE>java.lang.Object <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>weka.filters.Filter</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, <A HREF="../../weka/core/CapabilitiesHandler.html" title="interface in weka.core">CapabilitiesHandler</A></DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../weka/filters/unsupervised/attribute/AbstractTimeSeries.html" title="class in weka.filters.unsupervised.attribute">AbstractTimeSeries</A>, <A HREF="../../weka/filters/unsupervised/attribute/Add.html" title="class in weka.filters.unsupervised.attribute">Add</A>, <A HREF="../../weka/filters/unsupervised/attribute/AddCluster.html" title="class in weka.filters.unsupervised.attribute">AddCluster</A>, <A HREF="../../weka/filters/unsupervised/attribute/AddExpression.html" title="class in weka.filters.unsupervised.attribute">AddExpression</A>, <A HREF="../../weka/filters/unsupervised/attribute/AddID.html" title="class in weka.filters.unsupervised.attribute">AddID</A>, <A HREF="../../weka/filters/unsupervised/attribute/AddNoise.html" title="class in weka.filters.unsupervised.attribute">AddNoise</A>, <A HREF="../../weka/filters/unsupervised/attribute/AddValues.html" title="class in weka.filters.unsupervised.attribute">AddValues</A>, <A HREF="../../weka/filters/AllFilter.html" title="class in weka.filters">AllFilter</A>, <A HREF="../../weka/filters/supervised/attribute/AttributeSelection.html" title="class in weka.filters.supervised.attribute">AttributeSelection</A>, <A HREF="../../weka/filters/unsupervised/attribute/ChangeDateFormat.html" title="class in weka.filters.unsupervised.attribute">ChangeDateFormat</A>, <A HREF="../../weka/filters/supervised/attribute/ClassOrder.html" title="class in weka.filters.supervised.attribute">ClassOrder</A>, <A HREF="../../weka/filters/unsupervised/attribute/ClusterMembership.html" title="class in weka.filters.unsupervised.attribute">ClusterMembership</A>, <A HREF="../../weka/filters/unsupervised/attribute/Copy.html" title="class in weka.filters.unsupervised.attribute">Copy</A>, <A HREF="../../weka/filters/supervised/attribute/Discretize.html" title="class in weka.filters.supervised.attribute">Discretize</A>, <A HREF="../../weka/filters/unsupervised/attribute/FirstOrder.html" title="class in weka.filters.unsupervised.attribute">FirstOrder</A>, <A HREF="../../weka/filters/unsupervised/attribute/MakeIndicator.html" title="class in weka.filters.unsupervised.attribute">MakeIndicator</A>, <A HREF="../../weka/filters/unsupervised/attribute/MergeTwoValues.html" title="class in weka.filters.unsupervised.attribute">MergeTwoValues</A>, <A HREF="../../weka/filters/unsupervised/attribute/MultiInstanceToPropositional.html" title="class in weka.filters.unsupervised.attribute">MultiInstanceToPropositional</A>, <A HREF="../../weka/filters/supervised/attribute/NominalToBinary.html" title="class in weka.filters.supervised.attribute">NominalToBinary</A>, <A HREF="../../weka/filters/unsupervised/attribute/NominalToBinary.html" title="class in weka.filters.unsupervised.attribute">NominalToBinary</A>, <A HREF="../../weka/filters/unsupervised/instance/NonSparseToSparse.html" title="class in weka.filters.unsupervised.instance">NonSparseToSparse</A>, <A HREF="../../weka/filters/unsupervised/instance/Normalize.html" title="class in weka.filters.unsupervised.instance">Normalize</A>, <A HREF="../../weka/filters/unsupervised/attribute/NumericTransform.html" title="class in weka.filters.unsupervised.attribute">NumericTransform</A>, <A HREF="../../weka/filters/unsupervised/attribute/Obfuscate.html" title="class in weka.filters.unsupervised.attribute">Obfuscate</A>, <A HREF="../../weka/filters/unsupervised/attribute/PotentialClassIgnorer.html" title="class in weka.filters.unsupervised.attribute">PotentialClassIgnorer</A>, <A HREF="../../weka/filters/unsupervised/attribute/PropositionalToMultiInstance.html" title="class in weka.filters.unsupervised.attribute">PropositionalToMultiInstance</A>, <A HREF="../../weka/filters/unsupervised/instance/Randomize.html" title="class in weka.filters.unsupervised.instance">Randomize</A>, <A HREF="../../weka/filters/unsupervised/attribute/RandomProjection.html" title="class in weka.filters.unsupervised.attribute">RandomProjection</A>, <A HREF="../../weka/filters/unsupervised/attribute/Remove.html" title="class in weka.filters.unsupervised.attribute">Remove</A>, <A HREF="../../weka/filters/unsupervised/instance/RemoveFolds.html" title="class in weka.filters.unsupervised.instance">RemoveFolds</A>, <A HREF="../../weka/filters/unsupervised/instance/RemoveFrequentValues.html" title="class in weka.filters.unsupervised.instance">RemoveFrequentValues</A>, <A HREF="../../weka/filters/unsupervised/instance/RemoveMisclassified.html" title="class in weka.filters.unsupervised.instance">RemoveMisclassified</A>, <A HREF="../../weka/filters/unsupervised/instance/RemovePercentage.html" title="class in weka.filters.unsupervised.instance">RemovePercentage</A>, <A HREF="../../weka/filters/unsupervised/instance/RemoveRange.html" title="class in weka.filters.unsupervised.instance">RemoveRange</A>, <A HREF="../../weka/filters/unsupervised/attribute/RemoveType.html" title="class in weka.filters.unsupervised.attribute">RemoveType</A>, <A HREF="../../weka/filters/unsupervised/attribute/RemoveUseless.html" title="class in weka.filters.unsupervised.attribute">RemoveUseless</A>, <A HREF="../../weka/filters/unsupervised/instance/RemoveWithValues.html" title="class in weka.filters.unsupervised.instance">RemoveWithValues</A>, <A HREF="../../weka/filters/unsupervised/attribute/Reorder.html" title="class in weka.filters.unsupervised.attribute">Reorder</A>, <A HREF="../../weka/filters/supervised/instance/Resample.html" title="class in weka.filters.supervised.instance">Resample</A>, <A HREF="../../weka/filters/unsupervised/instance/Resample.html" title="class in weka.filters.unsupervised.instance">Resample</A>, <A HREF="../../weka/filters/SimpleFilter.html" title="class in weka.filters">SimpleFilter</A>, <A HREF="../../weka/filters/unsupervised/instance/SparseToNonSparse.html" title="class in weka.filters.unsupervised.instance">SparseToNonSparse</A>, <A HREF="../../weka/filters/supervised/instance/SpreadSubsample.html" title="class in weka.filters.supervised.instance">SpreadSubsample</A>, <A HREF="../../weka/filters/supervised/instance/StratifiedRemoveFolds.html" title="class in weka.filters.supervised.instance">StratifiedRemoveFolds</A>, <A HREF="../../weka/filters/unsupervised/attribute/StringToNominal.html" title="class in weka.filters.unsupervised.attribute">StringToNominal</A>, <A HREF="../../weka/filters/unsupervised/attribute/StringToWordVector.html" title="class in weka.filters.unsupervised.attribute">StringToWordVector</A>, <A HREF="../../weka/filters/unsupervised/attribute/SwapValues.html" title="class in weka.filters.unsupervised.attribute">SwapValues</A></DD></DL><HR><DL><DT><PRE>public abstract class <B>Filter</B><DT>extends java.lang.Object<DT>implements java.io.Serializable, <A HREF="../../weka/core/CapabilitiesHandler.html" title="interface in weka.core">CapabilitiesHandler</A></DL></PRE><P>An abstract class for instance filters: objects that take instances as input, carry out some transformation on the instance and then output the instance. The method implementations in this class assume that most of the work will be done in the methods overridden by subclasses.<p> A simple example of filter use. This example doesn't remove instances from the output queue until all instances have been input, so has higher memory consumption than an approach that uses output instances as they are made available:<p> <code> <pre> Filter filter = ..some type of filter.. Instances instances = ..some instances.. for (int i = 0; i < data.numInstances(); i++) { filter.input(data.instance(i)); } filter.batchFinished(); Instances newData = filter.outputFormat(); Instance processed; while ((processed = filter.output()) != null) { newData.add(processed); } ..do something with newData.. </pre> </code><P><P><DL><DT><B>Version:</B></DT> <DD>$Revision: 1.34 $</DD><DT><B>Author:</B></DT> <DD>Len Trigg (trigg@cs.waikato.ac.nz)</DD><DT><B>See Also:</B><DD><A HREF="../../serialized-form.html#weka.filters.Filter">Serialized Form</A></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/filters/Filter.html#Filter()">Filter</A></B>()</CODE><BR> </TD></TR></TABLE> <!-- ========== 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>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#batchFilterFile(weka.filters.Filter, java.lang.String[])">batchFilterFile</A></B>(<A HREF="../../weka/filters/Filter.html" title="class in weka.filters">Filter</A> filter, java.lang.String[] options)</CODE><BR> Method for testing filters ability to process multiple batches.</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#batchFinished()">batchFinished</A></B>()</CODE><BR> Signify that this batch of input to the filter is finished.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#filterFile(weka.filters.Filter, java.lang.String[])">filterFile</A></B>(<A HREF="../../weka/filters/Filter.html" title="class in weka.filters">Filter</A> filter, java.lang.String[] options)</CODE><BR> Method for testing filters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Capabilities.html" title="class in weka.core">Capabilities</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#getCapabilities()">getCapabilities</A></B>()</CODE><BR> Returns the Capabilities of this filter.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <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#getOutputFormat()">getOutputFormat</A></B>()</CODE><BR> Gets the format of the output instances.</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#input(weka.core.Instance)">input</A></B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance)</CODE><BR> Input an instance for filtering.</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#isFirstBatchDone()">isFirstBatchDone</A></B>()</CODE><BR> Returns true if the first batch of instances got processed.</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#isNewBatch()">isNewBatch</A></B>()</CODE><BR> Returns true if the a new batch was started, either a new instance of the filter was created or the batchFinished() method got called.</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#isOutputFormatDefined()">isOutputFormatDefined</A></B>()</CODE><BR> Returns whether the output format is ready to be collected</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE><BR> Main method for testing this class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../weka/filters/Filter.html" title="class in weka.filters">Filter</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#makeCopies(weka.filters.Filter, int)">makeCopies</A></B>(<A HREF="../../weka/filters/Filter.html" title="class in weka.filters">Filter</A> model, int num)</CODE><BR> Creates a given number of deep copies of the given filter using serialization.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../weka/filters/Filter.html" title="class in weka.filters">Filter</A></CODE></FONT></TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -